Skip to content

Commit 9f51a31

Browse files
mkitticlaude
andcommitted
fix: Address pre-commit CI failures in _morton_order
- Replace Unicode multiplication sign × with ASCII x in comment (RUF003) - Add explicit type annotation for np.argsort result to satisfy mypy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f339319 commit 9f51a31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zarr/core/indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> npt.NDArray[np.intp]:
15321532
order = all_coords[valid_mask]
15331533
else:
15341534
# Argsort strategy: enumerate all n_total valid coordinates directly,
1535-
# encode each to a Morton code, then sort by code. Avoids the or
1535+
# encode each to a Morton code, then sort by code. Avoids the 8x or
15361536
# larger overgeneration penalty for near-miss shapes like (33,33,33).
15371537
# Cost: O(n_total * bits) encode + O(n_total log n_total) sort,
15381538
# vs O(n_z * bits) = O(8 * n_total * bits) for ceiling.
@@ -1550,7 +1550,7 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> npt.NDArray[np.intp]:
15501550
z_codes |= ((all_coords[:, dim] >> coord_bit) & 1) << output_bit
15511551
output_bit += 1
15521552

1553-
sort_idx = np.argsort(z_codes, kind="stable")
1553+
sort_idx: npt.NDArray[np.intp] = np.argsort(z_codes, kind="stable")
15541554
order = all_coords[sort_idx]
15551555

15561556
order.flags.writeable = False

0 commit comments

Comments
 (0)