Skip to content

Commit 840b3b2

Browse files
committed
Add test for longer flat section
1 parent d9b5147 commit 840b3b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/time_of_flight/resample_tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def test_given_flat_sections_finds_strictly_increasing_parts_only(self):
2727
sections = resample.find_strictly_increasing_sections(var)
2828
assert sections == [slice(0, 2), slice(2, 5), slice(5, 7)]
2929

30+
def test_given_extended_flat_sections_finds_strictly_increasing_parts_only(self):
31+
var = sc.array(dims=['x'], values=[1, 2, 2, 2, 3, 4, 4, 5])
32+
sections = resample.find_strictly_increasing_sections(var)
33+
assert sections == [slice(0, 2), slice(3, 6), slice(6, 8)]
34+
3035
def test_given_decreasing_values_returns_empty_list(self):
3136
var = sc.array(dims=['x'], values=[5, 4, 3, 2, 1])
3237
sections = resample.find_strictly_increasing_sections(var)

0 commit comments

Comments
 (0)