Skip to content

Commit 3b9aa3e

Browse files
Merge branch 'master' into pre-commit-ci-update-config
2 parents 9aceb95 + 6d72df7 commit 3b9aa3e

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

parcels/fieldset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def computeTimeChunk(self, time=0., dt=1):
11861186
Default is 1.
11871187
"""
11881188
signdt = np.sign(dt)
1189-
nextTime = np.infty if dt > 0 else -np.infty
1189+
nextTime = np.inf if dt > 0 else -np.inf
11901190

11911191
for g in self.gridset.grids:
11921192
g.update_status = 'not_updated'
@@ -1320,7 +1320,7 @@ def computeTimeChunk(self, time=0., dt=1):
13201320
depth_data = f.grid.depth_field.data
13211321
f.grid.depth = depth_data if isinstance(depth_data, np.ndarray) else np.array(depth_data)
13221322

1323-
if abs(nextTime) == np.infty or np.isnan(nextTime): # Second happens when dt=0
1323+
if abs(nextTime) == np.inf or np.isnan(nextTime): # Second happens when dt=0
13241324
return nextTime
13251325
else:
13261326
nSteps = int((nextTime - time) / dt)

parcels/grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def add_Sdepth_periodic_halo(self, zonal, meridional, halosize):
169169
assert self.depth.shape[2] == self.ydim, "Third dim must be y."
170170

171171
def computeTimeChunk(self, f, time, signdt):
172-
nextTime_loc = np.infty if signdt >= 0 else -np.infty
172+
nextTime_loc = np.inf if signdt >= 0 else -np.inf
173173
periods = self.periods.value if isinstance(self.periods, c_int) else self.periods
174174
prev_time_indices = self.time
175175
if self.update_status == 'not_updated':

parcels/particlefile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ParticleFile(ABC):
5959
time_origin = None
6060
lonlatdepth_dtype = None
6161

62-
def __init__(self, name, particleset, outputdt=np.infty, chunks=None, create_new_zarrfile=True):
62+
def __init__(self, name, particleset, outputdt=np.inf, chunks=None, create_new_zarrfile=True):
6363

6464
self.outputdt = outputdt.total_seconds() if isinstance(outputdt, delta) else outputdt
6565
self.chunks = chunks

parcels/particleset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
882882
raise ValueError('Time step dt is too small')
883883
if (dt * 1e6) % 1 != 0:
884884
raise ValueError('Output interval should not have finer precision than 1e-6 s')
885-
outputdt = output_file.outputdt if output_file else np.infty
885+
outputdt = output_file.outputdt if output_file else np.inf
886886
if isinstance(outputdt, delta):
887887
outputdt = outputdt.total_seconds()
888888
if isinstance(callbackdt, delta):
@@ -920,19 +920,19 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
920920
self.particledata._data['dt'][:] = dt
921921

922922
if callbackdt is None:
923-
interupt_dts = [np.infty, outputdt]
923+
interupt_dts = [np.inf, outputdt]
924924
if self.repeatdt is not None:
925925
interupt_dts.append(self.repeatdt)
926926
callbackdt = np.min(np.array(interupt_dts))
927927
time = starttime
928928
if self.repeatdt:
929929
next_prelease = self.repeat_starttime + (abs(time - self.repeat_starttime) // self.repeatdt + 1) * self.repeatdt * np.sign(dt)
930930
else:
931-
next_prelease = np.infty if dt > 0 else - np.infty
931+
next_prelease = np.inf if dt > 0 else - np.inf
932932
if output_file:
933933
next_output = time + dt
934934
else:
935-
next_output = time + np.infty if dt > 0 else - np.infty
935+
next_output = time + np.inf if dt > 0 else - np.inf
936936
next_callback = time + callbackdt if dt > 0 else time - callbackdt
937937
next_input = self.fieldset.computeTimeChunk(time, np.sign(dt)) if self.fieldset is not None else np.inf
938938

0 commit comments

Comments
 (0)