Skip to content

Commit 159fe82

Browse files
author
Luke Shaw
committed
Fix slice checking
1 parent 4bfad23 commit 159fe82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blosc2/lazyexpr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,8 @@ def slices_eval( # noqa: C901
13781378
for i, (c, s) in enumerate(zip(coords, chunks, strict=True))
13791379
)
13801380
# Check whether current slice_ intersects with _slice
1381-
if _slice is not None and np.any(_slice != ()): # can't use != when _slice is np.int
1381+
checker = _slice.item() if hasattr(_slice, "item") else _slice # can't use != when _slice is np.int
1382+
if checker is not None and checker != ():
13821383
# Ensure that _slice is of type slice
13831384
key = ndindex.ndindex(_slice).expand(shape).raw
13841385
_slice = tuple(k if isinstance(k, slice) else slice(k, k + 1, None) for k in key)

0 commit comments

Comments
 (0)