Skip to content

Commit 3bdf248

Browse files
committed
testing of reduce in iter_contiguous
1 parent b49320c commit 3bdf248

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class BlockIndex:
4949
def iter_contiguous(self,
5050
__key: tp.Union[slice, np.ndarray, tp.List[int]],
5151
ascending: bool = False,
52+
reduce: bool = False,
5253
) -> tp.Iterator[tp.Tuple[int, int]]: ...
5354

5455

test/test_block_index.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,10 @@ def test_block_index_iter_contiguous_b(self) -> None:
610610
list(bi1.iter_contiguous(slice(0, 8, 3))),
611611
[(0, slice(0, 1, None)), (0, slice(3, 4, None)), (0, slice(6, 7, None))]
612612
)
613-
613+
self.assertEqual(
614+
list(bi1.iter_contiguous(slice(0, 8, 3), reduce=True)),
615+
[(0, 0), (0, 3), (0, 6)]
616+
)
614617

615618
def test_block_index_iter_contiguous_c(self) -> None:
616619
bi1 = BlockIndex()

0 commit comments

Comments
 (0)