hpcflow.sdk.persistence.zarr.ZarrStoreElement#

class hpcflow.sdk.persistence.zarr.ZarrStoreElement(id_, is_pending, index, es_idx, seq_idx, src_idx, task_ID, iteration_IDs)#

Bases: StoreElement[list[Any], dict[str, list[str]]]

Represents an element in a Zarr persistent store.

Methods

append_iteration_IDs

Return a copy, with additional iteration IDs.

decode

Initialise a StoreElement from persistent element data

encode

Prepare store elements data for the persistent store.

to_dict

Prepare data for the user-facing Element object.

Attributes

id_

The ID of the element.

is_pending

Whether the element has changes not yet persisted.

index

Index of the element within its parent task.

es_idx

Index of the element set containing this element.

seq_idx

Value sequence index map.

src_idx

Data source index map.

task_ID

ID of the task that contains this element.

iteration_IDs

IDs of element-iterations that belong to this element.

Parameters:
append_iteration_IDs(pend_IDs)#

Return a copy, with additional iteration IDs.

Parameters:

pend_IDs (Iterable[int]) –

Return type:

Self

classmethod decode(elem_dat, attrs)#

Initialise a StoreElement from persistent element data

Parameters:
  • elem_dat (ListAny) –

  • attrs (ZarrAttrs) –

Return type:

Self

encode(attrs)#

Prepare store elements data for the persistent store.

This method mutates attrs.

Parameters:

attrs (dict[str, list[str]]) –

Return type:

list[Any]

es_idx: int#

Index of the element set containing this element.

id_: int#

The ID of the element.

index: int#

Index of the element within its parent task.

is_pending: bool#

Whether the element has changes not yet persisted.

iteration_IDs: list[int]#

IDs of element-iterations that belong to this element.

seq_idx: dict[str, int]#

Value sequence index map.

src_idx: dict[str, int]#

Data source index map.

task_ID: int#

ID of the task that contains this element.

to_dict(iters)#

Prepare data for the user-facing Element object.

Return type:

dict[str, Any]