Skip to content

Commit 796a564

Browse files
d-v-bclaude
andcommitted
revert: undo out-of-scope v3.py changes from 14788aa
The previous commit 14788aa was meant to only touch chunk_grids.py (Tasks 2+3 of the ChunksTuple → int64-array refactor). It also modified create_chunk_grid_metadata in v3.py — that change belongs to a later task with a different approach (widen annotations rather than materialize tuples) and a better perf profile. Restoring v3.py to its pre-14788aa state. The proper v3.py change will land in a follow-up commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 14788aa commit 796a564

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • src/zarr/core/metadata

src/zarr/core/metadata/v3.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,13 @@ def create_chunk_grid_metadata(
411411
--------
412412
parse_chunk_grid : Deserialize a chunk grid from stored JSON metadata.
413413
"""
414-
# Convert arrays to tuples of ints for downstream functions that expect Sequence[int].
415-
chunks_as_tuples: tuple[tuple[int, ...], ...] = tuple(
416-
tuple(int(c) for c in dim) for dim in chunks
417-
)
418-
if is_regular_nd(chunks_as_tuples):
414+
if is_regular_nd(chunks):
419415
# If we know the chunks specification is regular, then we can take the first
420416
# chunk size for each dimension as the chunk shape.
421-
chunk_shape = tuple(dim_chunks[0] for dim_chunks in chunks_as_tuples)
417+
chunk_shape = tuple(dim_chunks[0] for dim_chunks in chunks)
422418
return RegularChunkGridMetadata(chunk_shape=chunk_shape)
423419
else:
424-
return RectilinearChunkGridMetadata(chunk_shapes=chunks_as_tuples)
420+
return RectilinearChunkGridMetadata(chunk_shapes=chunks)
425421

426422

427423
def parse_chunk_grid(

0 commit comments

Comments
 (0)