Skip to content

Commit ef18210

Browse files
committed
fix:Address type annotation and linting issues
1 parent aedce5a commit ef18210

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/zarr/core/indexing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> tuple[tuple[int, ...], ...]:
16671667
# Compute Morton order on squeezed shape
16681668
squeezed_order = _morton_order(squeezed_shape)
16691669
# Expand coordinates to include singleton dimensions (always 0)
1670-
order: list[tuple[int, ...]] = []
1670+
expanded: list[tuple[int, ...]] = []
16711671
for coord in squeezed_order:
16721672
full_coord: list[int] = []
16731673
squeezed_idx = 0
@@ -1677,8 +1677,8 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> tuple[tuple[int, ...], ...]:
16771677
else:
16781678
full_coord.append(coord[squeezed_idx])
16791679
squeezed_idx += 1
1680-
order.append(tuple(full_coord))
1681-
return tuple(order)
1680+
expanded.append(tuple(full_coord))
1681+
return tuple(expanded)
16821682
else:
16831683
# All dimensions are singletons, just return the single point
16841684
return ((0,) * len(chunk_shape),)
@@ -1696,10 +1696,11 @@ def _morton_order(chunk_shape: tuple[int, ...]) -> tuple[tuple[int, ...], ...]:
16961696
n_hypercube = 0
16971697

16981698
# Within the hypercube, no bounds checking needed - use vectorized decoding
1699+
order: list[tuple[int, ...]]
16991700
if n_hypercube > 0:
17001701
z_values = np.arange(n_hypercube, dtype=np.intp)
17011702
hypercube_coords = decode_morton_vectorized(z_values, chunk_shape)
1702-
order: list[tuple[int, ...]] = [tuple(row) for row in hypercube_coords]
1703+
order = [tuple(row) for row in hypercube_coords]
17031704
else:
17041705
order = []
17051706

0 commit comments

Comments
 (0)