hpcflow.sdk.persistence.zarr.ZarrStoreElementIter#

class hpcflow.sdk.persistence.zarr.ZarrStoreElementIter(id_, is_pending, element_ID, EARs_initialised, EAR_IDs, data_idx, schema_parameters, loop_idx=<factory>)#

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

Represents an element iteration in a Zarr persistent store.

Methods

append_EAR_IDs

Return a copy, with additional EAR IDs.

decode

Initialise a ZarrStoreElementIter from persistent element iteration data

encode

Prepare store element iteration data for the persistent store.

set_EARs_initialised

Return a copy with EARs_initialised set to True.

to_dict

Prepare data for the user-facing ElementIteration object.

update_loop_idx

Return a copy, with the loop index updated.

Attributes

id_

The ID of this element iteration.

is_pending

Whether the element iteration has changes not yet persisted.

element_ID

Which element is an iteration for.

EARs_initialised

Whether EARs have been initialised for this element iteration.

EAR_IDs

Maps task schema action indices to EARs by ID.

data_idx

Overall data index for the element-iteration, which maps parameter names to parameter data indices.

schema_parameters

List of parameters defined by the associated task schema.

loop_idx

What loops are being handled here and where they're up to.

Parameters:
  • id_ (int) –

  • is_pending (bool) –

  • element_ID (int) –

  • EARs_initialised (bool) –

  • EAR_IDs (dict[int, list[int]] | None) –

  • data_idx (DataIndex) –

  • schema_parameters (list[str]) –

  • loop_idx (Mapping[str, int]) –

EAR_IDs: dict[int, list[int]] | None#

Maps task schema action indices to EARs by ID.

EARs_initialised: bool#

Whether EARs have been initialised for this element iteration.

append_EAR_IDs(pend_IDs)#

Return a copy, with additional EAR IDs.

Parameters:

pend_IDs (Mapping[int, Sequence[int]]) –

Return type:

Self

data_idx: DataIndex#

Overall data index for the element-iteration, which maps parameter names to parameter data indices.

classmethod decode(iter_dat, attrs)#

Initialise a ZarrStoreElementIter from persistent element iteration data

Parameters:
  • iter_dat (ListAny) –

  • attrs (ZarrAttrs) –

Return type:

Self

element_ID: int#

Which element is an iteration for.

encode(attrs)#

Prepare store element iteration data for the persistent store.

This method mutates attrs.

Parameters:

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

Return type:

list[Any]

id_: int#

The ID of this element iteration.

is_pending: bool#

Whether the element iteration has changes not yet persisted.

loop_idx: Mapping[str, int]#

What loops are being handled here and where they’re up to.

schema_parameters: list[str]#

List of parameters defined by the associated task schema.

set_EARs_initialised()#

Return a copy with EARs_initialised set to True.

Return type:

Self

to_dict(EARs)#

Prepare data for the user-facing ElementIteration object.

Parameters:

EARs (dict[int, dict[str, Any]] | None) –

Return type:

dict[str, Any]

update_loop_idx(loop_idx)#

Return a copy, with the loop index updated.

Parameters:

loop_idx (Mapping[str, int]) –

Return type:

Self