Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature: support rectilinear chunk grid extension#3534

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
jhamman wants to merge13 commits intozarr-developers:main
base:main
Choose a base branch
Loading
fromjhamman:feature/rectilinear-chunk-grid

Conversation

@jhamman
Copy link
Member

@jhammanjhamman commentedOct 20, 2025
edited
Loading

(Marking this as a draft for now)

closes:#1595
replaces:#1483
xref:zarr-developers/zarr-extensions#25

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented indocs/user-guide/*.md
  • Changes documented as a new file inchanges/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

d-v-b, maxrjones, slevang, and norlandrhagen reacted with rocket emoji
@github-actionsgithub-actionsbot added the needs release notesAutomatically applied to PRs which haven't added release notes labelOct 20, 2025
@codecov
Copy link

codecovbot commentedOct 20, 2025
edited
Loading

Codecov Report

❌ Patch coverage is75.31532% with137 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.18%. Comparing base (950066b) to head (6eab392).
⚠️ Report is 12 commits behind head on main.

Files with missing linesPatch %Lines
src/zarr/core/chunk_grids.py67.24%94 Missing⚠️
src/zarr/core/indexing.py85.07%20 Missing⚠️
src/zarr/testing/strategies.py89.15%9 Missing⚠️
src/zarr/core/array.py81.39%8 Missing⚠️
src/zarr/core/metadata/v3.py25.00%6 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3534      +/-   ##==========================================+ Coverage   61.86%   62.18%   +0.32%==========================================  Files          85       85                Lines       10111    10604     +493     ==========================================+ Hits         6255     6594     +339- Misses       3856     4010     +154
Files with missing linesCoverage Δ
src/zarr/api/synchronous.py36.61% <ø> (ø)
src/zarr/core/group.py70.27% <ø> (+0.03%)⬆️
src/zarr/core/metadata/v3.py59.91% <25.00%> (+1.88%)⬆️
src/zarr/core/array.py68.69% <81.39%> (+0.07%)⬆️
src/zarr/testing/strategies.py94.11% <89.15%> (-3.70%)⬇️
src/zarr/core/indexing.py70.19% <85.07%> (+0.73%)⬆️
src/zarr/core/chunk_grids.py64.10% <67.24%> (+4.28%)⬆️

... and7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actionsgithub-actionsbot removed the needs release notesAutomatically applied to PRs which haven't added release notes labelOct 20, 2025
Comment on lines +574 to +575
when you need to align chunks with existing data partitions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
when you need to align chunks with existing data partitions.
when you need to align chunks with existing data partitions.
The specification for this chunking scheme can be found[here](https://github.com/zarr-developers/zarr-extensions/tree/main/chunk-grids/rectilinear/).

This link doesn't resolve yet but it will when the spec is merged.

Comment on lines +614 to +615
With variable chunking, the standard`.chunks` property is not available since chunks
have different sizes. Instead, access chunk information through the chunk grid:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think it would be better if.chunks just had a different type (tuple of tuples of ints)



@dataclass(frozen=True)
classRectilinearChunkGrid(ChunkGrid):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

thoughts on just calling this classRectilinear, and renaming theRegularChunkGrid toRegular? We could keep around aRegularChunkGrid class for compatibility. But I feel like people know these are chunk grids when they import them

)

@cached_property
def_cumulative_sizes(self)->tuple[tuple[int, ...], ...]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nice, this is cached

Comment on lines 584 to 588
chunk_shapes_rle= [
[[c,r]forc,rinzip(draw(dim_chunks),draw(repeats),strict=True)]
for_inrange(ndim)
]
returnRectilinearChunkGrid(chunk_shapes=chunk_shapes_rle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs fixing

@given(data=st.data())
asyncdeftest_basic_indexing(data:st.DataObject)->None:
zarray=data.draw(simple_arrays())
@given(data=st.data(),zarray=st.one_of([simple_arrays(),complex_chunked_arrays()]))
Copy link
Contributor

@dcheriandcherianOct 27, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Because the search space for the standardarrays strategy is so large, i made a different onecomplex_chunked_arrays that purely checks different chunk grids
withsimple_arrays() we are only spending 10% of our time tryingRectilinearChunkGrid so using this approach. We should boost number of examples too.

Comment on lines +668 to +669
2.**Not compatible with sharding**: You cannot use variable chunking together with
the sharding feature. Arrays must use either variable chunking or sharding, but not both.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I hope this is a temporary limitation! There's a natural extension of rectilinear chunk grids to rectilinear shard grids.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dcheriandcheriandcherian left review comments

@d-v-bd-v-bd-v-b left review comments

+1 more reviewer

@shoyershoyershoyer left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Implement Variable Chunking (ZEP003) in V3

4 participants

@jhamman@shoyer@dcherian@d-v-b

[8]ページ先頭

©2009-2025 Movatter.jp