herostools.actor.archiver.zarr_archiver

Classes

ZarrArchiver

HERODataArchiver that stores numpy array payloads in a zarr store.

Module Contents

class herostools.actor.archiver.zarr_archiver.ZarrArchiver(store_template: str, array_path_template: str, *args, **kwargs)[source]

Bases: herostools.actor.archiver.base.HERODataArchiver

HERODataArchiver that stores numpy array payloads in a zarr store.

The store root and the array key within it are both derived from Jinja2 templates rendered against the merged metadata. Opening the store in append mode (‘a’) means successive calls accumulate arrays in the same store directory.

Parameters:
  • store_template – Jinja2 template rendered to the zarr store root path.

  • array_path_template – Jinja2 template rendered to the array key within the store.

  • object_selector – Zenoh object selector for the devices to subscribe to.

  • event_name – Name of the event.

  • default_metadata – Default metadata available to both templates.

  • max_retries – Number of times to retry a failed store before dropping the item.

store_template
array_path_template
_store(source_name: str, payload: numpy.typing.NDArray[Any], metadata: dict) None[source]

Write the payload array into the zarr store.

Parameters:
  • source_name – Name of the event source (the HERO).

  • payload – Numpy array to store.

  • metadata – Incoming metadata merged with default_metadata.