def test_segment_indices_overlap(): segs = list(copper.segment_indices(9, 3, overlap=2)) assert segs == [(0, 3), (1, 4), (2, 5), (3, 6), (4, 7), (5, 8), (6, 9)]
def test_segment_indices_bad_length(): with pytest.warns(UserWarning): list(copper.segment_indices(11, 5)) with pytest.warns(UserWarning): list(copper.segment_indices(12, 5, overlap=2))
def test_segment_indices_simple(): segs = list(copper.segment_indices(8, 2)) assert segs == [(0, 2), (2, 4), (4, 6), (6, 8)]