eoio.writers.zarr package#

eoio.writers.zarr - Zarr writer

class eoio.writers.zarr.ZarrWriter(write_params: Dict[str, Any] | None = None)[source]#

Bases: BaseWriter

Write a Dataset or DataTree to a Zarr store.

all_write_params: Dict[str, str] = {'append_dim': 'dimension name to append along, or None (not supported for a DataTree)', 'chunks': 'mapping of dimension name to chunk size, or None to leave chunking alone', 'consolidated': 'True/False', 'create_parents': 'True/False', 'encode_attrs': 'True/False', 'encoding': 'per-variable encoding dict, or None. Ignored when appending', 'group': 'group path within the store, or None for the root (not supported for a DataTree)', 'mode': 'w/w-/a/a-/r+', 'on_nonconformance': 'warn/error/ignore', 'on_overlap': 'error/skip/allow - what to do when appending coordinates the store already has', 'update_history': 'True/False', 'zarr_format': '2/3, or None for the zarr default'}#
can_write(obj: Any) → WriteCapability[source]#

Report whether this writer can express obj with its current parameters.

Parameters:

obj – Candidate object.

Returns:

Capability, with a reason when the answer is no.

default_write_params: Dict[str, Any] = {'append_dim': None, 'chunks': None, 'consolidated': True, 'create_parents': True, 'encode_attrs': True, 'encoding': None, 'group': None, 'mode': 'w', 'on_nonconformance': 'warn', 'on_overlap': 'error', 'update_history': True, 'zarr_format': None}#
static get_extension() → str[source]#

Return the filename extension this writer produces, including the dot.

Used to name outputs when the caller gives a directory rather than a full path (see write_multi).

name: str = 'zarr'#

Name this writer is registered under. Concrete writers must set this.

write_dataset(obj: Dataset | DataTree, path: Path) → None[source]#

Write the object to a Zarr store.

Parameters:
  • obj – Dataset or DataTree, already encoded by the base class.

  • path – Destination store path.

Raises:

ImportError – If the optional zarr package is not installed.

Submodules#