ZarrNDSource¶
ZarrNDSource exposes a Zarr v2 or v3 array through ProxyNDSource.
Zarr decodes each logical chunk and Blosc2 stores the converted compressed
chunk in the surrounding Proxy or RemoteArray cache.
The source is assumed immutable for the cache lifetime. It supports scalar and zero-length arrays, and fixed-size boolean, integer, floating-point, complex, structured, string, datetime, and timedelta dtypes. Variable-length strings, object dtypes, and ZIP stores are not supported. Concurrent reads temporarily hold decoded chunks and conversion buffers in addition to the compressed cache.
Install local support with pip install "blosc2[zarr]". Remote stores also
need blosc2[fsspec] and the protocol driver, such as s3fs.
- class blosc2.ZarrNDSource(store, *, storage_options: dict | None = None, max_concurrency: int = 8, blocks=None, cparams=None, _traffic: Traffic | None = None, _urlpath: str | None = None, _path: str | None = None)[source]¶
Read an immutable Zarr array as Blosc2-compressed logical chunks.
Replacing data beneath the same store identity violates this adapter’s contract and may leave previously converted chunks stale. Peak working memory includes concurrently decoded Zarr chunks and their Blosc2 conversion buffers;
max_cache_bytesonly limits retained compressed chunks.- Attributes:
attrsThe user attributes of the remote array.
blocksThe block shape of the source.
chunksThe chunk shape of the source.
cparamsThe compression parameters of the source.
dtypeThe dtype of the source.
metaThe fixed-length metadata of the source.
shapeThe shape of the source.
vlmetaThe variable-length metadata of the source.
Methods
aget_chunk(nchunk)Return the compressed chunk in
selfasynchronously.get_chunk(nchunk)Return the compressed chunk in
self.