Skip to content

Commit bd6fb83

Browse files
committed
Remove already tested guard for unaligned operands
1 parent e27b135 commit bd6fb83

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/blosc2/lazyexpr.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,19 +1990,13 @@ def reduce_slices( # noqa: C901
19901990
use_miniexpr = False
19911991

19921992
# Check whether we can use miniexpr
1993-
if use_miniexpr:
1994-
same_shape = all(hasattr(op, "shape") and op.shape == shape for op in operands.values())
1995-
same_chunks = all(hasattr(op, "chunks") and op.chunks == chunks for op in operands.values())
1996-
same_blocks = all(hasattr(op, "blocks") and op.blocks == blocks for op in operands.values())
1997-
if not (same_shape and same_chunks and same_blocks):
1993+
if use_miniexpr and isinstance(expression, str):
1994+
has_complex = any(
1995+
isinstance(op, blosc2.NDArray) and blosc2.isdtype(op.dtype, "complex floating")
1996+
for op in operands.values()
1997+
)
1998+
if has_complex and any(tok in expression for tok in ("!=", "==", "<=", ">=", "<", ">")):
19981999
use_miniexpr = False
1999-
if use_miniexpr and isinstance(expression, str):
2000-
has_complex = any(
2001-
isinstance(op, blosc2.NDArray) and blosc2.isdtype(op.dtype, "complex floating")
2002-
for op in operands.values()
2003-
)
2004-
if has_complex and any(tok in expression for tok in ("!=", "==", "<=", ">=", "<", ">")):
2005-
use_miniexpr = False
20062000

20072001
if use_miniexpr:
20082002
# Experiments say that not splitting is best (at least on Apple Silicon M4 Pro)

0 commit comments

Comments
 (0)