Skip to content

Commit b4d5024

Browse files
mkitticlaude
andcommitted
fix: Cast argsort result via np.asarray to resolve mypy no-any-return
np.stack returns Any in mypy's view, so indexing into it also returns Any. Using np.asarray(..., dtype=np.intp) makes the type explicit and avoids the no-any-return error at the return site. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 94aae47 commit b4d5024

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/zarr/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> npt.NDArray[np.intp]:
15511551
output_bit += 1
15521552

15531553
sort_idx: npt.NDArray[np.intp] = np.argsort(z_codes, kind="stable")
1554-
order = all_coords[sort_idx]
1554+
order = np.asarray(all_coords[sort_idx], dtype=np.intp)
15551555

15561556
order.flags.writeable = False
15571557
return order

0 commit comments

Comments
 (0)