Skip to content

Feature/chunk grid array shape#3737

Open
d-v-b wants to merge 3 commits intozarr-developers:mainfrom
d-v-b:feature/chunk-grid-array-shape
Open

Feature/chunk grid array shape#3737
d-v-b wants to merge 3 commits intozarr-developers:mainfrom
d-v-b:feature/chunk-grid-array-shape

Conversation

@d-v-b
Copy link
Contributor

@d-v-b d-v-b commented Mar 1, 2026

Adds an array_shape attribute to ChunkGrid.

Depends on #3735, supports #3534

Resolves #3736. Opening as a draft while we figure out the JSON serialization issue.

d-v-b and others added 3 commits March 1, 2026 11:05
Move array_shape from a per-method parameter on ChunkGrid to a stored
attribute, validated once at construction time. This simplifies call
sites (especially in indexing.py) by eliminating redundant array_shape
arguments throughout the codebase.

Key changes:
- Add abstract `array_shape` property to ChunkGrid ABC
- Add `_array_shape` field and `array_shape` property to RegularChunkGrid
- Remove `array_shape` parameter from all ChunkGrid abstract methods
- Update `from_dict` to accept `array_shape` keyword argument
- Update `update_shape` to return a new instance with updated array_shape
- Refactor indexing.py to use chunk_grid methods directly instead of
  raw arithmetic on chunk_shape
- Update all construction sites to pass array_shape

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Mar 1, 2026
@d-v-b d-v-b marked this pull request as ready for review March 1, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chunk grid object should track array shape

1 participant