Skip to content

Commit 2fc0ba0

Browse files
committed
o Conform to new test format
1 parent 9901236 commit 2fc0ba0

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

test/grid/test_zonal.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,10 @@ def test_mismatched_dims():
9797
class TestConservativeZonalMean:
9898
"""Test conservative zonal mean functionality."""
9999

100-
gridfile_ne30 = current_path / "meshfiles" / "ugrid" / "outCSne30" / "outCSne30.ug"
101-
datafile_vortex_ne30 = current_path / "meshfiles" / "ugrid" / "outCSne30" / "outCSne30_vortex.nc"
102-
103-
def test_conservative_zonal_mean_basic(self):
100+
def test_conservative_zonal_mean_basic(self, gridpath, datasetpath):
104101
"""Test basic conservative zonal mean with bands."""
105-
grid_path = self.gridfile_ne30
106-
data_path = self.datafile_vortex_ne30
102+
grid_path = gridpath("ugrid", "outCSne30", "outCSne30.ug")
103+
data_path = datasetpath("ugrid", "outCSne30", "outCSne30_vortex.nc")
107104
uxds = ux.open_dataset(grid_path, data_path)
108105

109106
# Test with explicit bands
@@ -114,10 +111,10 @@ def test_conservative_zonal_mean_basic(self):
114111
assert result.shape == (len(bands) - 1,)
115112
assert np.all(np.isfinite(result.values))
116113

117-
def test_conservative_full_sphere_conservation(self):
114+
def test_conservative_full_sphere_conservation(self, gridpath, datasetpath):
118115
"""Test that single band covering entire sphere conserves global mean."""
119-
grid_path = self.gridfile_ne30
120-
data_path = self.datafile_vortex_ne30
116+
grid_path = gridpath("ugrid", "outCSne30", "outCSne30.ug")
117+
data_path = datasetpath("ugrid", "outCSne30", "outCSne30_vortex.nc")
121118
uxds = ux.open_dataset(grid_path, data_path)
122119

123120
# Single band covering entire sphere
@@ -130,10 +127,10 @@ def test_conservative_full_sphere_conservation(self):
130127
assert result.shape == (1,)
131128
assert result.values[0] == pytest.approx(global_mean.values, rel=0.01)
132129

133-
def test_conservative_vs_nonconservative_comparison(self):
130+
def test_conservative_vs_nonconservative_comparison(self, gridpath, datasetpath):
134131
"""Compare conservative and non-conservative methods."""
135-
grid_path = self.gridfile_ne30
136-
data_path = self.datafile_vortex_ne30
132+
grid_path = gridpath("ugrid", "outCSne30", "outCSne30.ug")
133+
data_path = datasetpath("ugrid", "outCSne30", "outCSne30_vortex.nc")
137134
uxds = ux.open_dataset(grid_path, data_path)
138135

139136
# Non-conservative at band centers

0 commit comments

Comments
 (0)