Skip to content

Commit 6a9304a

Browse files
use numpy.datetime/numpy.timedelta in test_particleset
1 parent 51ec275 commit 6a9304a

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tests/v4/test_particleset.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import timedelta
22

3+
import numpy as np
34
import pytest
45

56
from parcels import (
@@ -47,11 +48,14 @@ def test_uxstommelgyre_pset_execute(verbose_progress):
4748
lon=[30.0],
4849
lat=[5.0],
4950
depth=[50.0],
50-
time=[timedelta(seconds=0.0)],
51+
time=[np.timedelta64(0, "s")],
5152
pclass=Particle,
5253
)
5354
pset.execute(
54-
runtime=timedelta(minutes=10), dt=timedelta(seconds=60), pyfunc=AdvectionEE, verbose_progress=verbose_progress
55+
runtime=np.timedelta64(10, "m"),
56+
dt=np.timedelta64(60, "s"),
57+
pyfunc=AdvectionEE,
58+
verbose_progress=verbose_progress,
5559
)
5660

5761

@@ -94,4 +98,6 @@ def test_uxstommelgyre_pset_execute_output():
9498
name="stommel_uxarray_particles.zarr", # the file name
9599
outputdt=timedelta(minutes=5), # the time step of the outputs
96100
)
97-
pset.execute(runtime=timedelta(minutes=10), dt=timedelta(seconds=60), pyfunc=AdvectionEE, output_file=output_file)
101+
pset.execute(
102+
runtime=np.timedelta64(10, "m"), dt=np.timedelta64(60, "s"), pyfunc=AdvectionEE, output_file=output_file
103+
)

0 commit comments

Comments
 (0)