-
-
Notifications
You must be signed in to change notification settings - Fork 403
refactor: simplify internal chunk representation #3899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
d-v-b
merged 41 commits into
zarr-developers:main
from
d-v-b:refactor/simplify-internal-chunk-representation
May 7, 2026
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
5990390
refactor: rename guess_chunks to more clearly indicate that it guesse…
d-v-b 74ae11a
fix: use the same chunk normalization path in all cases
d-v-b 9735a85
refactor: use newtype pattern
d-v-b c40c5ff
docs: changelog
d-v-b a9b68d8
fix: handle 0-length arrays
d-v-b 88e93ad
test: test untested cases of chunk normalization
d-v-b fcd5ab0
fix: don't accept inane input
d-v-b 5c56197
test: check error states in normalize_chunks_1d
d-v-b 9fc3fea
refactor: make resolvedchunking recursive to support nested sharding
d-v-b 2659f1c
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b c6a5095
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b fb7da3a
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b f6fc818
test: add _assert_chunks_equal helper for ChunksTuple
d-v-b 14788aa
perf: ChunksTuple uses 1D int64 arrays per axis
d-v-b 796a564
revert: undo out-of-scope v3.py changes from 14788aa
d-v-b 62ce735
fix: cast ChunksTuple elements to int at consumer sites in array.py
d-v-b 547836b
fix: widen is_regular_* annotations and cast ChunksTuple in create_ch…
d-v-b e68cdfc
test: cast ChunksTuple elements to int in create_array_metadata fixture
d-v-b 12a325a
test: rewrite ChunksTuple equality checks and add return-type charact…
d-v-b 33ee8a1
perf: vectorize is_regular_1d for ndarray inputs
d-v-b 4bc4678
refactor: rename ResolvedChunking to ChunkLayout
d-v-b 6b02c13
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b 4668fe5
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b b74b78d
chore: add informative error for invalid chunk grid parameter
d-v-b 2e8e8cb
chore: make tests compact
d-v-b fc24c87
fix: typos
d-v-b bdb32d2
test: add tests for regular grid helper functions
d-v-b f8a391e
fix: reject chunks=True
d-v-b 09eda7e
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b 9f54550
Merge branch 'main' of https://github.com/zarr-developers/zarr-python…
d-v-b 2907297
Merge branch 'refactor/simplify-internal-chunk-representation' of htt…
d-v-b a86beb0
docs: update changelog
d-v-b e283f4e
docs: remove unneeded changelog entry
d-v-b 424439b
test: test for explicit 0-sized chunk length rejection
d-v-b 4d8df32
Merge branch 'main' into refactor/simplify-internal-chunk-representation
d-v-b 6a56483
chore: hoist imports
d-v-b 0d56915
refactor: add as_regular_shape helper routine
d-v-b b3dd194
Update src/zarr/core/chunk_grids.py
d-v-b 9a2c6f2
Update src/zarr/core/chunk_grids.py
d-v-b e49c87d
Update src/zarr/core/array.py
d-v-b aff9cb5
chore: cleanup
d-v-b File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Make chunk normalization properly handle `-1` as a compact representation of the | ||
| length of an entire axis. Reject several previously-accepted but ill-defined | ||
| chunk specifications: `chunks=True` (previously silently produced size-1 chunks), | ||
| chunk tuples shorter than the array's number of dimensions (previously padded to | ||
| the array's shape), and `None` as a per-dimension chunk size. These all now | ||
| raise informative errors. Also fix chunk handling for 0-length array dimensions, | ||
| and add explicit rejection of 0-length chunks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.