Skip to content

Commit 7fccebf

Browse files
Fixes from merge conflicts
1 parent 1bab706 commit 7fccebf

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

tests/test_advection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
@pytest.mark.parametrize("mesh", ["spherical", "flat"])
3232
def test_advection_zonal(mesh, npart=10):
33-
"""Particles at high latitude move geographically faster due to the pole correction in `GeographicPolar`."""
33+
"""Particles at high latitude move geographically faster due to the pole correction."""
3434
ds = simple_UV_dataset(mesh=mesh)
3535
ds["U"].data[:] = 1.0
3636
fieldset = FieldSet.from_sgrid_conventions(ds, mesh=mesh)
@@ -45,7 +45,7 @@ def test_advection_zonal(mesh, npart=10):
4545

4646

4747
def test_advection_zonal_with_particlefile(tmp_store):
48-
"""Particles at high latitude move geographically faster due to the pole correction in `GeographicPolar`."""
48+
"""Particles at high latitude move geographically faster due to the pole correction."""
4949
npart = 10
5050
ds = simple_UV_dataset(mesh="flat")
5151
ds["U"].data[:] = 1.0
@@ -439,8 +439,6 @@ def test_nemo_curvilinear_fieldset():
439439

440440
U = parcels.Field("U", ds["U"], grid, interp_method=XLinear)
441441
V = parcels.Field("V", ds["V"], grid, interp_method=XLinear)
442-
U.units = parcels.GeographicPolar()
443-
V.units = parcels.GeographicPolar() # U and V need GeographicPolar for C-Grid interpolation to work correctly
444442
UV = parcels.VectorField("UV", U, V, vector_interp_method=CGrid_Velocity)
445443
fieldset = parcels.FieldSet([U, V, UV])
446444

@@ -522,8 +520,6 @@ def test_nemo_3D_curvilinear_fieldset(kernel):
522520
U = parcels.Field("U", ds["U"], grid, interp_method=XLinear)
523521
V = parcels.Field("V", ds["V"], grid, interp_method=XLinear)
524522
W = parcels.Field("W", ds["W"], grid, interp_method=XLinear)
525-
U.units = parcels.GeographicPolar()
526-
V.units = parcels.GeographicPolar() # U and V need GoegraphicPolar for C-Grid interpolation to work correctly
527523
UV = parcels.VectorField("UV", U, V, vector_interp_method=CGrid_Velocity)
528524
UVW = parcels.VectorField("UVW", U, V, W, vector_interp_method=CGrid_Velocity)
529525
fieldset = parcels.FieldSet([U, V, W, UV, UVW])

tests/test_interpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_interpolation_mesh_type(mesh, npart=10):
172172
time = 0.0
173173
u_expected = 1.0 if mesh == "flat" else 1.0 / (1852 * 60 * np.cos(np.radians(lat)))
174174

175-
assert np.isclose(fieldset.U[time, 0, lat, 0], u_expected, atol=1e-7)
175+
assert fieldset.U.eval(time, 0, lat, 0) == 1.0
176176
assert fieldset.V[time, 0, lat, 0] == 0.0
177177

178178
u, v = fieldset.UV[time, 0, lat, 0]

tests/test_uxarray_fieldset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_fesom2_square_delaunay_uniform_z_coordinate_eval():
122122
P = Field(name="p", data=ds.p, grid=grid, interp_method=UxPiecewiseLinearNode)
123123
fieldset = FieldSet([UVW, P, UVW.U, UVW.V, UVW.W])
124124

125-
(u, v, w) = fieldset.UVW.eval(time=[0.0], z=[1.0], y=[30.0], x=[30.0], applyConversion=False)
125+
(u, v, w) = fieldset.UVW.eval(time=[0.0], z=[1.0], y=[30.0], x=[30.0], apply_conversion=False)
126126
assert np.allclose([u.item(), v.item(), w.item()], [1.0, 1.0, 0.0], rtol=1e-3, atol=1e-6)
127127

128128
assert np.isclose(

0 commit comments

Comments
 (0)