Skip to content

Commit

Permalink
Urgent: require numpy < 2.0 (#780)
Browse files Browse the repository at this point in the history
require numpy < 2.0
  • Loading branch information
lfarv committed Jun 17, 2024
1 parent 2aee95d commit faa0470
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pyat/at/matching/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def header():
return '\n{:>12s}{:>13s}{:>16s}{:>16s}\n'.format(
'Name', 'Initial', 'Final ', 'Variation')

def status(self, ring: Lattice, vini=np.NaN):
def status(self, ring: Lattice, vini=np.nan):
vnow = self.get(ring)
return '{:>12s}{: 16e}{: 16e}{: 16e}'.format(
self.name, vini, vnow, (vnow - vini))
Expand Down Expand Up @@ -235,7 +235,7 @@ def header():
def status(self, ring: Lattice, initial=None):
"""Return a string giving the actual state of constraints"""
if initial is None:
initial = repeat(np.NaN)
initial = repeat(np.nan)
strs = []
for name, ini, now, target in zip(self.name, initial,
self.values(ring), self.target):
Expand Down
8 changes: 4 additions & 4 deletions pyat/at/physics/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _closure(m22):
beta = m22[0, 1] / sinmu
return alpha, beta, cosmu + sinmu*1j
except ValueError: # Unstable motion
return numpy.NaN, numpy.NaN, numpy.NaN
return numpy.nan, numpy.nan, numpy.nan


# noinspection PyShadowingNames,PyPep8Naming
Expand All @@ -127,7 +127,7 @@ def _tunes(ring, **kwargs):
except AtError:
warnings.warn(AtWarning('Unstable ring'))
tunes = numpy.empty(nd)
tunes[:] = numpy.NaN
tunes[:] = numpy.nan
return tunes


Expand Down Expand Up @@ -509,7 +509,7 @@ def unwrap(mu):
('s_pos', numpy.float64)]
data0 = (d0, orb0, mt, get_s_pos(ring, len(ring))[0])
datas = (ds, orbs, ms, spos)
damping_times = numpy.NaN
damping_times = numpy.nan

if get_w:
dtype = dtype + wtype
Expand All @@ -523,7 +523,7 @@ def unwrap(mu):
deltap = o0up[4] - o0dn[4]
chrom = (tunesup - tunesdn) / deltap
else:
chrom = numpy.NaN
chrom = numpy.nan

beamdata = numpy.array((tunes, chrom, damping_times),
dtype=[('tune', numpy.float64, (dms,)),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ classifiers = [
requires-python = ">=3.7"
dependencies = [
"importlib-resources;python_version<'3.9'",
"numpy>=1.16.6",
"numpy >=1.16.6, <2.0",
"scipy>=1.4.0"
]

Expand Down

0 comments on commit faa0470

Please sign in to comment.