Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 1.12 KB

4356.bugfix.md

File metadata and controls

16 lines (15 loc) · 1.12 KB

Coordinate selections (including vindex masks) and orthogonal integer-array selections no longer allocate counts proportional to the total number of chunks. Previously, selecting a few points on an array with billions of chunks could raise MemoryError. The indexers now store occupied chunk IDs and run-end offsets (chunk_run_ends); unsorted selections can still require sorting. The dense chunk_nitems / chunk_nitems_cumsum attributes of CoordinateIndexer and IntArrayDimIndexer remain available without deprecation warnings. Each array is materialized on first access and cached, preserving its identity and in-place mutations on subsequent reads. These attributes remain dataclass fields, so dataclasses.asdict() materializes them; repr omits them to avoid dense allocation during inspection. Accessing a dense attribute still allocates memory proportional to the full chunk grid.

The new zarr.core.common.ceildiv_int helper uses exact integer arithmetic for chunk counts and slice calculations. For example, ceildiv_int(2**62 - 1, 1) returns 2**62 - 1. The existing ceildiv helper retains its floating-point behavior.