You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 71d5bb1
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(chunk-grids): remove unused members of the dimension grids
Nothing in the library called `with_extent`, `ngridcells` or
`_unique_edge_lengths` on `FixedDimension` / `VaryingDimension`, did an
`isinstance` check against `DimensionGrid`, or used `is_regular_1d` /
`is_regular_nd`. Remove them along with the tests that only exercised
them.
`VaryingDimension.chunk_offset` no longer maps a negative chunk index
to 0, a guard left over from indexing a tuple of prefix sums. Both
dimension types raise the same `IndexError` message from
`index_to_chunk`, and docstrings that described the old tuple-backed
behaviour are corrected.
Assisted-by: ClaudeCode:claude-fable-5.1
Opening an array with a rectilinear chunk grid, and indexing it, now costs time and memory proportional to the size of the grid's run-length encoded metadata rather than to its number of chunks: a stored grid such as `[[1, 1000000000000]]`, a few hundred bytes of JSON, previously took seconds per ten million chunks to open and could exhaust memory. The explicit edges in `RectilinearChunkGridMetadata.chunk_shapes` and `VaryingDimension.edges` are now held as `zarr.core.common.RunLengthEdges`, an immutable run-length encoded value that is not a sequence: it has no `len`, indexing or iteration and does not compare equal to a `tuple`. Its `expand()` method yields one entry per chunk. `VaryingDimension.cumulative` is removed; `VaryingDimension.chunk_offset` gives the start of a chunk. The repr of a chunk grid shows a dimension of more than 100 chunks in its run-length encoded form.
1
+
Opening an array with a rectilinear chunk grid, and indexing it, now costs time and memory proportional to the size of the grid's run-length encoded metadata rather than to its number of chunks: a stored grid such as `[[1, 1000000000000]]`, a few hundred bytes of JSON, previously took seconds per ten million chunks to open and could exhaust memory. The explicit edges in `RectilinearChunkGridMetadata.chunk_shapes` and `VaryingDimension.edges` are now held as `zarr.core.common.RunLengthEdges`, an immutable run-length encoded value that is not a sequence: it has no `len`, indexing or iteration and does not compare equal to a `tuple`. Its `expand()` method yields one entry per chunk. `VaryingDimension.cumulative` is removed; `VaryingDimension.chunk_offset` gives the start of a chunk. The repr of a chunk grid shows a dimension of more than 100 chunks in its run-length encoded form. The unused `with_extent` and `ngridcells` members of `FixedDimension` and `VaryingDimension`, and the unused helpers `zarr.core.chunk_grids.is_regular_1d` and `is_regular_nd`, are removed; both dimension types now raise the same `IndexError` message from `index_to_chunk`.
0 commit comments