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 38cc191 commit 30c19e6Copy full SHA for 30c19e6
pysteps/tests/test_extrapolation_semilagrangian.py
@@ -24,6 +24,26 @@ def test_semilagrangian():
24
assert_array_almost_equal(result, expected)
25
26
27
+def test_wrong_input_dimensions():
28
+ p_1d = np.ones(8)
29
+ p_2d = np.ones((8, 8))
30
+ p_3d = np.ones((8, 8, 2))
31
+ v_2d = np.ones((8, 8))
32
+ v_3d = np.stack([v_2d, v_2d])
33
+
34
+ num_timesteps = 1
35
36
+ invalid_inputs = [
37
+ (p_1d, v_3d),
38
+ (p_2d, v_2d),
39
+ (p_3d, v_2d),
40
+ (p_3d, v_3d),
41
+ ]
42
+ for precip, velocity in invalid_inputs:
43
+ with pytest.raises(ValueError):
44
+ extrapolate(precip, velocity, num_timesteps)
45
46
47
def test_ascending_time_step():
48
precip = np.ones((8, 8))
49
v = np.ones((8, 8))
0 commit comments