iarray.zarr_proxy#
- iarray.zarr_proxy(zarr_urlpath, cfg: Optional[Config] = None, **kwargs) IArray #
Return a read-only Zarr proxy array.
cfg and kwargs are the same than for
empty()
except by nthreads, which is always set to 1 (multi-threading is not yet supported).The data type and chunks must not differ from the original Zarr array.
A Zarr proxy is a regular IArray array but with a special attribute called zproxy_urlpath. This attribute is protected when attrs.clear() is used; but can still be deleted with del attrs[“zproxy_urlpath”], attrs.popitem() or attrs.pop(“zproxy_urlpath”).
This IArray has an additional attribute called proxy_attrs which contains the Zarr attributes. The user can get and set these attributes.
- Parameters
zarr_urlpath¶ (str) – The path to the Zarr array. If it is stored in the cloud, the path must begin with
s3://
.- Returns
The zarr proxy array.
- Return type
Notes
As a proxy, this array does not contain the data from the original array, it only reads it when needed. But if a
save()
is done, a copy of all the data will be made and assigned to a new and usual on disk IArray container. To create a persistent proxy on-disk, you can specificy theurlpath
duringzarr_proxy()
execution time.