Skip to content

Commit

Permalink
Merge branch 'master' into 1.4-release
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Sep 14, 2020
2 parents 5cf2a55 + 2a68d94 commit 650b6b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions ndindex/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ def as_subindex(self, index):
if not res.count_nonzero:
raise ValueError("Indices do not intersect")

if res.array.all() and res.ndim > 0:
return Tuple(*[Slice(None)]*res.ndim)
return res

if not isinstance(index, Slice):
Expand Down
3 changes: 3 additions & 0 deletions ndindex/tests/test_assubindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from .helpers import ndindices, short_shapes, assert_equal


@example((slice(0, 8), slice(0, 9), slice(0, 10)),
([2, 5, 6, 7], slice(1, 9, 1), slice(5, 10, 1)),
(20, 20, 20))
@example((), (None, array([], dtype=intp)), 0)
@example((), array([], dtype=bool), 0)
@example((), IntegerArray(0), 1)
Expand Down
2 changes: 1 addition & 1 deletion ndindex/tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def as_subindex(self, index):
else:
subindex = self_arg.as_subindex(index_arg)
if isinstance(subindex, Tuple):
assert all(i == Slice(None) for i in subindex.args)
assert subindex == ()
subindex # Workaround https://github.com/nedbat/coveragepy/issues/1029
continue
if isinstance(subindex, BooleanArray):
Expand Down

0 comments on commit 650b6b1

Please sign in to comment.