We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c18031 commit cf142c1Copy full SHA for cf142c1
pysteps/tests/test_utils_cleansing.py
@@ -62,6 +62,15 @@ def test_decluster():
62
assert np.all(V_dec == np.median(V, axis=0))
63
64
65
+def test_decluster_value_error_is_raise_when_input_has_nan():
66
+ coords = np.ones((3, 1))
67
+ input_array = np.ones((3, 1))
68
+
69
+ input_array[1, 0] = np.nan
70
+ with pytest.raises(ValueError):
71
+ cleansing.decluster(coords, input_array, scale=20)
72
73
74
def test_detect_outlier_constant():
75
"""Test that a constant input produces no outliers and that warnings are raised"""
76
@@ -176,8 +185,8 @@ def test_detect_outlier_multivariate_local():
176
185
assert outliers.sum() == 2
177
186
178
187
179
-def test_detect_outlier_input_dims():
180
- V = np.zeros((20, 3, 2))
188
+def test_detect_outlier_wrong_input_dims_raise_error():
189
+ input_array = np.zeros((20, 3, 2))
181
190
thr_std_devs = 1
182
191
with pytest.raises(ValueError):
183
- cleansing.detect_outliers(V, thr_std_devs)
192
+ cleansing.detect_outliers(input_array, thr_std_devs)
0 commit comments