@@ -140,16 +140,16 @@ def test_raises_error_if_weights_lat_and_lon_dims_dont_align_with_data_var_dims(
140
140
with pytest .raises (ValueError ):
141
141
self .ds .spatial .average ("ts" , axis = ["X" , "Y" ], weights = weights )
142
142
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 (
144
144
self ,
145
145
):
146
- # ensure error if required_weight less than zero
146
+ # ensure error if minimum_weight less than zero
147
147
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 )
149
149
150
- # ensure error if required_weight greater than 1
150
+ # ensure error if minimum_weight greater than 1
151
151
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 )
153
153
154
154
def test_spatial_average_for_lat_region_and_keep_weights (self ):
155
155
ds = self .ds .copy ()
@@ -265,7 +265,7 @@ def test_spatial_average_for_lat_and_lon_region_and_keep_weights(self):
265
265
266
266
xr .testing .assert_allclose (result , expected )
267
267
268
- def test_spatial_average_with_required_weight (self ):
268
+ def test_spatial_average_with_minimum_weight (self ):
269
269
ds = self .ds .copy ()
270
270
271
271
# insert a nan
@@ -276,7 +276,7 @@ def test_spatial_average_with_required_weight(self):
276
276
axis = ["X" , "Y" ],
277
277
lat_bounds = (- 5.0 , 5 ),
278
278
lon_bounds = (- 170 , - 120.1 ),
279
- required_weight = 1.0 ,
279
+ minimum_weight = 1.0 ,
280
280
)
281
281
282
282
expected = self .ds .copy ()
@@ -288,15 +288,15 @@ def test_spatial_average_with_required_weight(self):
288
288
289
289
xr .testing .assert_allclose (result , expected )
290
290
291
- def test_spatial_average_with_required_weight_as_None (self ):
291
+ def test_spatial_average_with_minimum_weight_as_None (self ):
292
292
ds = self .ds .copy ()
293
293
294
294
result = ds .spatial .average (
295
295
"ts" ,
296
296
axis = ["X" , "Y" ],
297
297
lat_bounds = (- 5.0 , 5 ),
298
298
lon_bounds = (- 170 , - 120.1 ),
299
- required_weight = None ,
299
+ minimum_weight = None ,
300
300
)
301
301
302
302
expected = self .ds .copy ()
0 commit comments