Zarr
linc_convert.utils.io.zarr ¶
ZarrIO module for handling Zarr data structures.
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 |
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 |
from_config
classmethod
¶
from_config(out, zarr_config)
Create a Zarr group from a configuration object.
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.
ZarrTSArray ¶
ZarrTSArray(ts_array)
Bases: ZarrArray
Zarr array backed by TensorStore.
Initialize the ZarrTSArray with a TensorStore array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ts_array
|
TensorStore
|
Underlying TensorStore array. |
required |
open
classmethod
¶
open(path, mode='a', *, zarr_version=3)
Open an existing Zarr array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, PathLike]
|
Path to the array’s directory. |
required |
zarr_version
|
(2, 3)
|
Zarr format version to use. |
2
|
mode
|
(r, 'r+', a, w, 'w-')
|
Persistence mode: 'r' means read only (must exist); 'r+' means read/write (must exist); 'a' means read/write (create if doesn't exist); 'w' means create (overwrite if exists); 'w-' means create (fail if exists). |
'r','r+','a','w','w-'
|
Returns:
| Type | Description |
|---|---|
ZarrTSArray
|
|
ZarrTSGroup ¶
ZarrTSGroup(store_path)
Bases: ZarrGroup
Zarr Group implementation using TensorStore as backend.
Initialize the ZarrTSGroup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store_path
|
Union[str, PathLike]
|
Path to the group’s directory. |
required |
from_config
classmethod
¶
from_config(out, zarr_config)
Create a ZarrTSGroup from a configuration object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zarr_config
|
ZarrConfig
|
Configuration with .out and .zarr_version. |
required |
Returns:
| Type | Description |
|---|---|
ZarrTSGroup
|
|
open
classmethod
¶
open(path, mode='a', *, zarr_version=3)
Open or create a Zarr group backed by TensorStore.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, PathLike]
|
Path to the Zarr group. |
required |
mode
|
(r, 'r+', a, w, 'w-')
|
Persistence mode: 'r' means read only (must exist); 'r+' means read/write (must exist); 'a' means read/write (create if doesn't exist); 'w' means create (overwrite if exists); 'w-' means create (fail if exists). |
'r','r+','a','w','w-'
|
zarr_version
|
(2, 3)
|
Zarr format version. |
2,3
|
Returns:
| Type | Description |
|---|---|
ZarrTSGroup
|
|
create_group ¶
create_group(name, overwrite=False)
Create or open a subgroup within this group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
overwrite
|
bool
|
If True, delete existing before creating. |
False
|
Returns:
| Type | Description |
|---|---|
ZarrTSGroup
|
|
create_array ¶
create_array(name, shape, dtype=np.int32, *, overwrite=True, data=None, zarr_config=None, **kwargs)
Create a new array within this group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
shape
|
Sequence[int]
|
|
required |
dtype
|
DTypeLike
|
|
int32
|
overwrite
|
bool
|
|
True
|
zarr_config
|
ZarrConfig | None
|
|
None
|
data
|
ArrayLike | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
ZarrTSArray
|
|
create_array_from_base ¶
create_array_from_base(name, shape, data=None, **kwargs)
Create a new array using metadata of an existing base-level array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
shape
|
Sequence[int]
|
|
required |
data
|
ArrayLike | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
ZarrTSArray
|
|