Skip to content

Commit

Permalink
add tests for empty series
Browse files Browse the repository at this point in the history
  • Loading branch information
jarq6c committed Feb 3, 2025
1 parent f903f9f commit fbb1041
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/events/tests/test_baseflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,16 @@ def test_separate_baseflow(setup_noisy_series):
assert b.maximum_baseflow_index >= 0.0
assert b.values.sum() < s.sum()
assert b.values.count() == s.count()

def test_empty_series():
with pytest.raises(AssertionError, match="empty input series"):
b = bf.separate_baseflow(np.empty(0), "15min")

with pytest.raises(AssertionError, match="empty input series"):
b = bf.apply_filter(np.empty(0), 0.9, 0.5)

with pytest.raises(AssertionError, match="empty input series"):
b = bf.maximum_baseflow_analysis(np.empty(0), 0.9)

with pytest.raises(AssertionError, match="empty input series"):
a = bf.linear_recession_analysis(np.empty(0))

0 comments on commit fbb1041

Please sign in to comment.