Skip to content

Commit ddfa6ba

Browse files
[#2031] Update tests to use nz coord for z in tests
1 parent bb37185 commit ddfa6ba

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

tests/v4/test_uxarray_fieldset.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def uv_fesom_channel(ds_fesom_channel) -> VectorField:
3737
U=Field(
3838
name="U",
3939
data=ds_fesom_channel.U,
40-
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.nz),
40+
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.coords["nz"]),
4141
interp_method=UXPiecewiseConstantFace,
4242
),
4343
V=Field(
4444
name="V",
4545
data=ds_fesom_channel.V,
46-
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.nz),
46+
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.coords["nz"]),
4747
interp_method=UXPiecewiseConstantFace,
4848
),
4949
)
@@ -57,19 +57,19 @@ def uvw_fesom_channel(ds_fesom_channel) -> VectorField:
5757
U=Field(
5858
name="U",
5959
data=ds_fesom_channel.U,
60-
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.nz),
60+
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.coords["nz"]),
6161
interp_method=UXPiecewiseConstantFace,
6262
),
6363
V=Field(
6464
name="V",
6565
data=ds_fesom_channel.V,
66-
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.nz),
66+
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.coords["nz"]),
6767
interp_method=UXPiecewiseConstantFace,
6868
),
6969
W=Field(
7070
name="W",
7171
data=ds_fesom_channel.W,
72-
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.nz),
72+
grid=UxGrid(ds_fesom_channel.uxgrid, z=ds_fesom_channel.coords["nz"]),
7373
interp_method=UXPiecewiseLinearNode,
7474
),
7575
)
@@ -126,11 +126,11 @@ def test_fesom2_square_delaunay_uniform_z_coordinate_eval():
126126
ds = datasets_unstructured["fesom2_square_delaunay_uniform_z_coordinate"]
127127
UVW = VectorField(
128128
name="UVW",
129-
U=Field(name="U", data=ds.U, grid=UxGrid(ds.uxgrid, z=ds.nz), interp_method=UXPiecewiseConstantFace),
130-
V=Field(name="V", data=ds.V, grid=UxGrid(ds.uxgrid, z=ds.nz), interp_method=UXPiecewiseConstantFace),
131-
W=Field(name="W", data=ds.W, grid=UxGrid(ds.uxgrid, z=ds.nz), interp_method=UXPiecewiseLinearNode),
129+
U=Field(name="U", data=ds.U, grid=UxGrid(ds.uxgrid, z=ds.coords["nz"]), interp_method=UXPiecewiseConstantFace),
130+
V=Field(name="V", data=ds.V, grid=UxGrid(ds.uxgrid, z=ds.coords["nz"]), interp_method=UXPiecewiseConstantFace),
131+
W=Field(name="W", data=ds.W, grid=UxGrid(ds.uxgrid, z=ds.coords["nz"]), interp_method=UXPiecewiseLinearNode),
132132
)
133-
P = Field(name="p", data=ds.p, grid=UxGrid(ds.uxgrid, z=ds.nz), interp_method=UXPiecewiseConstantFace)
133+
P = Field(name="p", data=ds.p, grid=UxGrid(ds.uxgrid, z=ds.coords["nz"]), interp_method=UXPiecewiseConstantFace)
134134
fieldset = FieldSet([UVW, P, UVW.U, UVW.V, UVW.W])
135135

136136
assert fieldset.U.eval(time=ds.time[0].values, z=1.0, y=30.0, x=30.0, applyConversion=False) == 1.0

0 commit comments

Comments
 (0)