Skip to content

Commit e9b1c80

Browse files
committed
Relax the condition in which blocks should 'fit' in chunks
1 parent fb0c1ba commit e9b1c80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/blosc2/lazyexpr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,8 +1303,8 @@ def fast_eval( # noqa: C901
13031303
if not (isinstance(op, blosc2.NDArray) and op.urlpath is None and out is None):
13041304
use_miniexpr = False
13051305
break
1306-
# Ensure blocks fit exactly in chunks for the n-dim case
1307-
blocks_fit = builtins.all(c % b == 0 for c, b in zip(op.chunks, op.blocks, strict=True))
1306+
# Ensure blocks fit exactly in chunks for the n-dim case, except for the first dimension
1307+
blocks_fit = builtins.all(c % b == 0 for c, b in zip(op.chunks[1:], op.blocks[1:], strict=True))
13081308
if len(op.shape) != 1 and not blocks_fit:
13091309
use_miniexpr = False
13101310
break
@@ -2018,8 +2018,8 @@ def reduce_slices( # noqa: C901
20182018
if has_complex and any(tok in expression for tok in ("!=", "==", "<=", ">=", "<", ">")):
20192019
use_miniexpr = False
20202020
for op in operands.values():
2021-
# Ensure blocks fit exactly in chunks for the n-dim case
2022-
blocks_fit = builtins.all(c % b == 0 for c, b in zip(op.chunks, op.blocks, strict=True))
2021+
# Ensure blocks fit exactly in chunks for the n-dim case, except for the first dimension
2022+
blocks_fit = builtins.all(c % b == 0 for c, b in zip(op.chunks[1:], op.blocks[1:], strict=True))
20232023
if len(op.shape) != 1 and not blocks_fit:
20242024
use_miniexpr = False
20252025
break

0 commit comments

Comments
 (0)