hpcflow.sdk.persistence.base.StoreElement#

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

Bases: Generic[SerFormT, ContextT]

Represents an element in a persistent store.

Parameters:
  • id (int) – The ID of the element.

  • is_pending (bool) – Whether the element has changes not yet persisted.

  • index (int) – Index of the element within its parent task.

  • es_idx (int) – Index of the element set containing 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.

  • iteration_IDs (list[int]) – IDs of element-iterations that belong to this element.

  • id_ (int) –

Methods

append_iteration_IDs

Return a copy, with additional iteration IDs.

decode

Initialise a StoreElement from store element data

encode

Prepare store element 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.

append_iteration_IDs(pend_IDs)#

Return a copy, with additional iteration IDs.

Parameters:

pend_IDs (Iterable[int]) –

Return type:

Self

abstract classmethod decode(elem_dat, context)#

Initialise a StoreElement from store element data

Parameters:
  • elem_dat (SerFormT) –

  • context (ContextT) –

Return type:

Self

abstract encode(context)#

Prepare store element data for the persistent store.

Parameters:

context (ContextT) –

Return type:

SerFormT

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]