Skip to content

v3 arrays have no .chunks attribute #1925

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

Closed
rabernat opened this issue May 29, 2024 · 1 comment · Fixed by #1929
Closed

v3 arrays have no .chunks attribute #1925

rabernat opened this issue May 29, 2024 · 1 comment · Fixed by #1929
Milestone

Comments

@rabernat
Copy link
Contributor

rabernat commented May 29, 2024

Similar to: #1924

V2 arrays have a .chunks attribute: https://zarr.readthedocs.io/en/stable/_autoapi/zarr.core.Array.html#zarr.core.Array.chunks

V3 arrays don't:

import zarr
arr = zarr.Array.create(store=zarr.store.MemoryStore(), shape=(10,), chunks=(5,), dtype="i4")
arr.chunks
# -> attribute error

# instead it is available at
arr.metadata.chunk_grid.chunk_shape

It would be a pretty disruptive API change to remove this. I understand that the ChunkGrid concept makes this more complicated to support. We should reimplement a sane default for this attribute for regular chunk grids. So much code likely relies on this parameter.

@rabernat rabernat added the V3 label May 29, 2024
@jhamman
Copy link
Member

jhamman commented May 29, 2024

👍 - we've discussed this. A bit of thought will be needed for how to handle other chunk grids (as you say) but for now, we should just pass arr.metadata.chunk_grid.chunk_shape as a property of the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants