Skip to content

Commit 38cc191

Browse files
Test ascending (#302)
* New test for ascending values * second commit with a last blank line * Add missing import --------- Co-authored-by: Daniele Nerini <daniele.nerini@gmail.com>
1 parent 8f55472 commit 38cc191

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pysteps/tests/test_extrapolation_semilagrangian.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import numpy as np
3+
import pytest
34
from numpy.testing import assert_array_almost_equal
45

56
from pysteps.extrapolation.semilagrangian import extrapolate
@@ -23,6 +24,16 @@ def test_semilagrangian():
2324
assert_array_almost_equal(result, expected)
2425

2526

27+
def test_ascending_time_step():
28+
precip = np.ones((8, 8))
29+
v = np.ones((8, 8))
30+
velocity = np.stack([v, v])
31+
32+
not_ascending_timesteps = [1, 2, 3, 5, 4, 6, 7]
33+
with pytest.raises(ValueError):
34+
extrapolate(precip, velocity, not_ascending_timesteps)
35+
36+
2637
def test_semilagrangian_timesteps():
2738
"""Test semilagrangian extrapolation with list of timesteps."""
2839
# inputs

0 commit comments

Comments
 (0)