Skip to content

Commit 1899dc9

Browse files
Removing dt=0 test from globcurrent
As not supported anymore since parcels v3.0 Also cleaning up code as suggested by @VascoSch92
1 parent 031603f commit 1899dc9

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

docs/examples/example_globcurrent.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ def test_globcurrent_time_extrapolation_error(mode, use_xarray):
173173
pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
174174

175175

176-
@pytest.mark.parametrize('mode', ['scipy', 'jit'])
177-
@pytest.mark.parametrize('use_xarray', [True, False])
178-
def test_globcurrent_dt0(mode, use_xarray):
179-
fieldset = set_globcurrent_fieldset(use_xarray=use_xarray)
180-
pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[25], lat=[-35])
181-
pset.execute(AdvectionRK4, dt=0.)
182-
183-
184176
@pytest.mark.parametrize('mode', ['scipy', 'jit'])
185177
@pytest.mark.parametrize('dt', [-300, 300])
186178
@pytest.mark.parametrize('with_starttime', [True, False])

parcels/particleset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
880880
dt = dt.total_seconds()
881881
if abs(dt) <= 1e-6:
882882
raise ValueError('Time step dt is too small')
883-
if dt*1e6 % 1 != 0:
883+
if (dt * 1e6) % 1 != 0:
884884
raise ValueError('Output interval should not have finer precision than 1e-6 s')
885885
outputdt = output_file.outputdt if output_file else np.infty
886886
if isinstance(outputdt, delta):

0 commit comments

Comments
 (0)