Skip to content

Zarr python

linc_convert.utils.io.zarr.drivers.zarr_python

ZarrIO Implementation using the zarr-python library.

ZarrPythonArray

ZarrPythonArray(array)

Bases: ZarrArray

Zarr Array implementation using the zarr-python library.

Initialize the ZarrPythonArray with a zarr.Array.

Parameters:

Name Type Description Default
array Array

Underlying Zarr array.

required

ndim property

ndim

Number of dimensions of the array.

shape property

shape

Shape of the array.

dtype property

dtype

Data type of the array.

chunks property

chunks

Chunk shape for the array.

shards property

shards

Shard shape, if supported; otherwise None.

attrs property

attrs

Access metadata/attributes for this node.

zarr_version property

zarr_version

Get the Zarr format version.

__getitem__

__getitem__(key)

Read data from the array.

__setitem__

__setitem__(key, value)

Write data to the array.

__getattr__

__getattr__(name)

Delegate any unknown attributes to the underlying array.

ZarrPythonGroup

ZarrPythonGroup(zarr_group)

Bases: ZarrGroup

Zarr Group implementation using the zarr-python library.

Initialize the ZarrPythonGroup with a zarr.Group.

Parameters:

Name Type Description Default
zarr_group Group

Underlying Zarr Python group.

required

attrs property

attrs

Access metadata/attributes for this node.

zarr_version property

zarr_version

Get the Zarr format version.

from_config classmethod

from_config(out, zarr_config)

Create a Zarr group from a configuration object.

keys

keys()

Get the names of all subgroups and arrays in this group.

__getitem__

__getitem__(key)

Get a subgroup or array by name within this group.

__setitem__

__setitem__(key, value)

Set a subgroup or array by name within this group.

__delitem__

__delitem__(key)

Delete a subgroup or array by name within this group.

__iter__

__iter__()

Iterate over the names of all subgroups and arrays in this group.

__getattr__

__getattr__(name)

Delegate attribute access to the underlying Zarr group.

create_group

create_group(name, overwrite=False)

Create or open a subgroup within this group.

create_array

create_array(name, shape, dtype, *, zarr_config=None, data=None, **kwargs)

Create a new array within this group.

create_array_from_base

create_array_from_base(name, shape, data=None, **kwargs)

Create a new array using the properties from a base_level object.