zarr-indexing¶
This library is for modelling and transforming NumPy-style array indexing expressions. It separates the declaration of an array indexing expression from the result of that expression.
Developed for use in zarr.
Inspired by TensorStore, which pioneered the approach used here.
Install¶
zarr-indexing is developed in the
zarr-python repository
and released independently of zarr itself:
Quickstart¶
Wrap an array, compose a lazy view through .lazy, and call result() when
you want its values:
import numpy as np
from zarr_indexing import LazyArray
source = np.array([10, 11, 12, 13, 14, 15])
view = LazyArray.from_numpy(source).lazy[2:5]
view.result()
# array([12, 13, 14])
Nothing is read until the result() call, however many selections are
composed. Lazy views compose shows how
the chain stays one description, and where the materialization boundary is.
Learn more¶
- Visual guide — one selection followed from coordinates to chunk plan. Using lazy indexing, start at An index selects coordinates; integrating a chunked backend, start at A request becomes a chunk plan.
- Indexing pattern reference — every selection form with its NumPy-verified result.
- Integration boundaries — what a reader, writer, or scheduler owns, and what the plan owns.
- Lazy indexing a NumPy array and with Dask — runnable examples.
- The ndsel wire format — the JSON form of a selection.
- Design notes — TensorStore lineage, box vs query, and deliberate limits.
- API reference
- Release notes · License (MIT)