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 6808f75
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(chunk-grids): make RunLengthEdges a plain value, not a sequence
Per-chunk access belongs to `VaryingDimension`, which binds edges to an
extent; the metadata model only needs runs, their total and the RLE
form. A `Sequence[int]` interface on `RunLengthEdges` invited
`for e in edges` or `list(edges)` on a grid with 2**40 chunks.
Drop `len`, indexing, slicing, iteration, membership and `count`. Add
`size_of(index)` for one edge and `expand()` as the single, explicit way
to visit every edge. `RectilinearChunkGridMetadata.chunk_shapes` is now
annotated as what it holds, `tuple[int | RunLengthEdges, ...]`, while its
constructor still accepts tuples and lists of edges.
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 sequence of the edges that is not a `tuple`and does not compare equal to one: use `tuple(edges)`to compare against a tuple. `VaryingDimension.cumulative` is now computed on access. 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 now computed on access. The repr of a chunk grid shows a dimension of more than 100 chunks in its run-length encoded form.
0 commit comments