Skip to content

Commit 3c6cc8e

Browse files
Adding interpolators to Field creation
1 parent 83e76da commit 3c6cc8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_xgrid.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
_transpose_xfield_data_to_tzyx,
1818
)
1919
from parcels._datasets.structured.generic import X, Y, Z, datasets
20+
from parcels.interpolators import XLinear
2021
from tests import utils
2122

2223
GridTestCase = namedtuple("GridTestCase", ["ds", "attr", "expected"])
@@ -142,7 +143,7 @@ def test_vertical1D_field():
142143
coords={"depth": (["depth"], np.linspace(0, 1, nz), {"axis": "Z"})},
143144
)
144145
grid = XGrid.from_dataset(ds)
145-
field = Field("z1d", ds["z1d"], grid)
146+
field = Field("z1d", ds["z1d"], grid, XLinear)
146147

147148
assert field.eval(np.timedelta64(0, "s"), 0.45, 0, 0) == 4.5
148149

@@ -154,7 +155,7 @@ def test_time1D_field():
154155
coords={"time": (["time"], timerange, {"axis": "T"})},
155156
)
156157
grid = XGrid.from_dataset(ds)
157-
field = Field("t1d", ds["t1d"], grid)
158+
field = Field("t1d", ds["t1d"], grid, XLinear)
158159

159160
assert field.eval(np.datetime64("2000-01-10T12:00:00"), -20, 5, 6) == 9.5
160161

0 commit comments

Comments
 (0)