@@ -119,10 +119,10 @@ def test_fesom2_square_delaunay_uniform_z_coordinate_eval():
119119 P = Field (name = "p" , data = ds .p , grid = UxGrid (ds .uxgrid , z = ds .coords ["nz" ]), interp_method = UXPiecewiseLinearNode )
120120 fieldset = FieldSet ([UVW , P , UVW .U , UVW .V , UVW .W ])
121121
122- assert fieldset .U .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 30.0 , applyConversion = False ) == 1.0
123- assert fieldset .V .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 30.0 , applyConversion = False ) == 1.0
124- assert fieldset .W .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 30.0 , applyConversion = False ) == 0.0
125- assert fieldset .p .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 30.0 , applyConversion = False ) == 1.0
122+ assert fieldset .U .eval (time = ds .time [0 ].values , z = [ 1.0 ] , y = [ 30.0 ] , x = [ 30.0 ] , applyConversion = False ) == 1.0
123+ assert fieldset .V .eval (time = ds .time [0 ].values , z = [ 1.0 ] , y = [ 30.0 ] , x = [ 30.0 ] , applyConversion = False ) == 1.0
124+ assert fieldset .W .eval (time = ds .time [0 ].values , z = [ 1.0 ] , y = [ 30.0 ] , x = [ 30.0 ] , applyConversion = False ) == 0.0
125+ assert fieldset .p .eval (time = ds .time [0 ].values , z = [ 1.0 ] , y = [ 30.0 ] , x = [ 30.0 ] , applyConversion = False ) == 1.0
126126
127127
128128def test_fesom2_square_delaunay_antimeridian_eval ():
@@ -132,10 +132,19 @@ def test_fesom2_square_delaunay_antimeridian_eval():
132132 Since the underlying data is constant, we can check that the values are as expected.
133133 """
134134 ds = datasets_unstructured ["fesom2_square_delaunay_antimeridian" ]
135- P = Field (name = "p" , data = ds .p , grid = UxGrid (ds .uxgrid , z = ds .coords ["nz" ]), interp_method = UXPiecewiseLinearNode )
135+ P = Field (
136+ name = "p" ,
137+ data = ds .p ,
138+ grid = UxGrid (ds .uxgrid , z = ds .coords ["nz" ], mesh = "spherical" ),
139+ interp_method = UXPiecewiseLinearNode ,
140+ )
136141 fieldset = FieldSet ([P ])
137142
138- assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = - 170.0 , applyConversion = False ), 1.0 )
139- assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = - 180.0 , applyConversion = False ), 1.0 )
140- assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 180.0 , applyConversion = False ), 1.0 )
141- assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = 1.0 , y = 30.0 , x = 170.0 , applyConversion = False ), 1.0 )
143+ assert np .isclose (
144+ fieldset .p .eval (time = ds .time [0 ].values , z = [1.0 ], y = [30.0 ], x = [- 170.0 ], applyConversion = False ), 1.0
145+ )
146+ assert np .isclose (
147+ fieldset .p .eval (time = ds .time [0 ].values , z = [1.0 ], y = [30.0 ], x = [- 180.0 ], applyConversion = False ), 1.0
148+ )
149+ assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = [1.0 ], y = [30.0 ], x = [180.0 ], applyConversion = False ), 1.0 )
150+ assert np .isclose (fieldset .p .eval (time = ds .time [0 ].values , z = [1.0 ], y = [30.0 ], x = [170.0 ], applyConversion = False ), 1.0 )
0 commit comments