hpcflow.sdk.persistence.base.StoreElementIter#
- class hpcflow.sdk.persistence.base.StoreElementIter(id_, is_pending, element_ID, EARs_initialised, EAR_IDs, data_idx, schema_parameters, loop_idx=<factory>)#
Bases:
Generic
[SerFormT
,ContextT
]Represents an element iteration in a persistent store.
- Parameters:
id (int) – The ID of this element iteration.
is_pending (bool) – Whether the element iteration has changes not yet persisted.
element_ID (int) – Which element is an iteration for.
EARs_initialised (bool) – Whether EARs have been initialised for this element iteration.
EAR_IDs (dict[int, list[int]] | None) – Maps task schema action indices to EARs by ID.
data_idx (DataIndex) – Overall data index for the element-iteration, which maps parameter names to parameter data indices.
schema_parameters (list[str]) – List of parameters defined by the associated task schema.
loop_idx (Mapping[str, int]) – What loops are being handled here and where they’re up to.
id_ (int) –
Methods
Return a copy, with additional EAR IDs.
Initialise a StoreElementIter from persistent store element iteration data
Prepare store element iteration data for the persistent store.
Return a copy with EARs_initialised set to True.
Prepare data for the user-facing ElementIteration object.
Return a copy, with the loop index updated.
Attributes
The ID of this element iteration.
Whether the element iteration has changes not yet persisted.
Which element is an iteration for.
Whether EARs have been initialised for this element iteration.
Maps task schema action indices to EARs by ID.
Overall data index for the element-iteration, which maps parameter names to parameter data indices.
List of parameters defined by the associated task schema.
What loops are being handled here and where they're up to.
- append_EAR_IDs(pend_IDs)#
Return a copy, with additional EAR IDs.
- data_idx: DataIndex#
Overall data index for the element-iteration, which maps parameter names to parameter data indices.
- abstract classmethod decode(iter_dat, context)#
Initialise a StoreElementIter from persistent store element iteration data
- Parameters:
iter_dat (SerFormT) –
context (ContextT) –
- Return type:
Self
- abstract encode(context)#
Prepare store element iteration data for the persistent store.
- Parameters:
context (ContextT) –
- Return type:
SerFormT
- 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.