Skip to content

Commit

Permalink
Test ascending (#302)
Browse files Browse the repository at this point in the history
* New test for ascending values

* second commit with a last blank line

* Add missing import

---------

Co-authored-by: Daniele Nerini <[email protected]>
  • Loading branch information
pierrejavelle and dnerini authored Apr 27, 2024
1 parent 8f55472 commit 38cc191
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pysteps/tests/test_extrapolation_semilagrangian.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal

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


def test_ascending_time_step():
precip = np.ones((8, 8))
v = np.ones((8, 8))
velocity = np.stack([v, v])

not_ascending_timesteps = [1, 2, 3, 5, 4, 6, 7]
with pytest.raises(ValueError):
extrapolate(precip, velocity, not_ascending_timesteps)


def test_semilagrangian_timesteps():
"""Test semilagrangian extrapolation with list of timesteps."""
# inputs
Expand Down

0 comments on commit 38cc191

Please sign in to comment.