API reference¶
Choose the guide stopping point that matches your job before following module links:
- Use lazy indexing: finish
Lazy views compose,
then open
zarr_indexing.lazy_arrayforLazyArray. - Integrate a chunked source: finish
A plan is a product of per-axis tables,
then open
zarr_indexing.chunk_resolutionforplan_chunksandGridPartition. Start with Coordinates are addresses if literal coordinates are unfamiliar.
The modules are layered: the transform algebra at the bottom, chunk resolution and the wire format built on top of it.
The transform algebra
zarr_indexing.domain—IndexDomain, a rectangular region of integer coordinates with an explicit (possibly non-zero) originzarr_indexing.output_map—ConstantMap,DimensionMap, andArrayMap: three representations of a set of integer coordinates, one per storage dimensionzarr_indexing.transform—IndexTransform, which pairs a domain with output maps, plus the indexing ([...],.oindex,.vindex),intersect, andtranslateoperations, andselection_to_transformtransforms into one
Chunk resolution
zarr_indexing.chunk_resolution—plan_chunks, which lazily projects a request through a caller-selected grid, the reusableChunkPlanand paired-transformChunkProjectionvalues, and the plan's factored form:GridPartition(fromChunkPlan.partition), holding oneStridedSetorIndexedSettable per axis and aJointSetfor correlated index arrayszarr_indexing.grid—DimensionGridLike, the Protocol describing the narrow chunk-grid surface chunk resolution consumes, so that nothing here importszarr, plusEdgeDimensionGridanddimension_grids_from_chunks, a concrete per-axis grid for callers with no zarr grid to hand
Lazy arrays
zarr_indexing.lazy_array—LazyArray, a wrapper for system-memory/basic-indexing sources that adds a.lazyaccessor for TensorStore-style deferred indexing, plusPartitionandparts()/with_parts(), which determine the boxes a read is broken into. Device sources require an explicit custom reader that transfers into the supplied system-memory outputzarr_indexing.reader—Reader, the backend execution boundary that obtains the values described by a complete transform;basic_readerserves conservative duck arrays andnumpy_readeris selected explicitly byLazyArray.from_numpyzarr_indexing.boundary— the translation between NumPy's positional dialect and the transform algebra's literal coordinates
The ndsel wire format (see the guide)
zarr_indexing.messages—parse_ndsel/normalize_ndsel, the pure JSON→JSON message layer, andNdselErrorzarr_indexing.json— lowering between canonical ndsel bodies and in-memory transforms
Errors
zarr_indexing.errors— the index-error types this package raises, also exported at the top level.zarr.errorsdefines classes of the same names, which are different objects; both subclassIndexError
Test support (needs the testing extra)
zarr_indexing.testing.stateful—ChainedIndexingStateMachine, a Hypothesis state machine that composes indexing steps onto aLazyArraywrapping your array and checks every step against NumPy, plusapply_selection, the NumPy model it checks againstzarr_indexing.testing.strategies— the selection strategies the machine draws from, for a project that has its own harness
Every name listed in zarr_indexing.__all__ is re-exported at the top level,
so from zarr_indexing import IndexTransform and
from zarr_indexing.transform import IndexTransform are equivalent.
zarr_indexing.testing is deliberately not among them: it imports
hypothesis, which the rest of the package does not.