Skip to content

Commit 2d0499a

Browse files
committed
Add fastpath todo
1 parent 7d9c6a2 commit 2d0499a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/zarr/core/chunk_grids.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ class VaryingDimension:
137137
nchunks: int = field(init=False, repr=False) # cached at construction
138138
ngridcells: int = field(init=False, repr=False) # cached at construction
139139

140+
# TODO: with_extent/resize re-create VaryingDimension with the same edges,
141+
# recomputing cumulative sums (O(n)) and nchunks (bisect). For long
142+
# dimensions, add a fast path that reuses the existing cumulative tuple.
140143
def __init__(self, edges: Sequence[int], extent: int) -> None:
141144
edges_tuple = tuple(edges)
142145
if not edges_tuple:

0 commit comments

Comments
 (0)