Skip to content

Commit 5b2afff

Browse files
committed
update tests for minimum_weight parameter
1 parent 11e8005 commit 5b2afff

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test_spatial.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ def test_raises_error_if_weights_lat_and_lon_dims_dont_align_with_data_var_dims(
140140
with pytest.raises(ValueError):
141141
self.ds.spatial.average("ts", axis=["X", "Y"], weights=weights)
142142

143-
def test_raises_error_if_required_weight_not_between_zero_and_one(
143+
def test_raises_error_if_minimum_weight_not_between_zero_and_one(
144144
self,
145145
):
146-
# ensure error if required_weight less than zero
146+
# ensure error if minimum_weight less than zero
147147
with pytest.raises(ValueError):
148-
self.ds.spatial.average("ts", axis=["X", "Y"], required_weight=-0.01)
148+
self.ds.spatial.average("ts", axis=["X", "Y"], minimum_weight=-0.01)
149149

150-
# ensure error if required_weight greater than 1
150+
# ensure error if minimum_weight greater than 1
151151
with pytest.raises(ValueError):
152-
self.ds.spatial.average("ts", axis=["X", "Y"], required_weight=1.01)
152+
self.ds.spatial.average("ts", axis=["X", "Y"], minimum_weight=1.01)
153153

154154
def test_spatial_average_for_lat_region_and_keep_weights(self):
155155
ds = self.ds.copy()
@@ -265,7 +265,7 @@ def test_spatial_average_for_lat_and_lon_region_and_keep_weights(self):
265265

266266
xr.testing.assert_allclose(result, expected)
267267

268-
def test_spatial_average_with_required_weight(self):
268+
def test_spatial_average_with_minimum_weight(self):
269269
ds = self.ds.copy()
270270

271271
# insert a nan
@@ -276,7 +276,7 @@ def test_spatial_average_with_required_weight(self):
276276
axis=["X", "Y"],
277277
lat_bounds=(-5.0, 5),
278278
lon_bounds=(-170, -120.1),
279-
required_weight=1.0,
279+
minimum_weight=1.0,
280280
)
281281

282282
expected = self.ds.copy()
@@ -288,15 +288,15 @@ def test_spatial_average_with_required_weight(self):
288288

289289
xr.testing.assert_allclose(result, expected)
290290

291-
def test_spatial_average_with_required_weight_as_None(self):
291+
def test_spatial_average_with_minimum_weight_as_None(self):
292292
ds = self.ds.copy()
293293

294294
result = ds.spatial.average(
295295
"ts",
296296
axis=["X", "Y"],
297297
lat_bounds=(-5.0, 5),
298298
lon_bounds=(-170, -120.1),
299-
required_weight=None,
299+
minimum_weight=None,
300300
)
301301

302302
expected = self.ds.copy()

0 commit comments

Comments
 (0)