Skip to content

Commit 0dc8697

Browse files
committed
Restore compatibility with numpy < 2
1 parent 66e35a4 commit 0dc8697

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/blosc2/ctable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ def _build_lex_keys(
20272027
if not asc:
20282028
if raw.dtype.kind in "US":
20292029
# strings can't be negated — invert via rank
2030-
rank = np.argsort(np.argsort(raw, stable=True), stable=True)
2030+
rank = np.argsort(np.argsort(raw, kind="stable"), kind="stable")
20312031
lex_keys.append((n - 1 - rank).astype(np.intp))
20322032
elif np.issubdtype(raw.dtype, np.unsignedinteger):
20332033
lex_keys.append(-raw.astype(np.int64))

src/blosc2/lazyexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@ def chunked_eval( # noqa: C901
27592759
unit_steps = np.all([s.step == 1 for s in item.raw if isinstance(s, slice)])
27602760
# shape of slice, if non-unit steps have to decompress full array into memory
27612761
shape_operands = item.newshape(shape) if unit_steps else shape
2762-
_dtype = kwargs.get("dtype", np.float64)
2762+
_dtype = np.dtype(kwargs.get("dtype", np.float64))
27632763
size_operands = math.prod(shape_operands) * len(operands) * _dtype.itemsize
27642764
# Only take the fast path if the size of operands is relatively small
27652765
if size_operands < blosc2.MAX_FAST_PATH_SIZE:

0 commit comments

Comments
 (0)