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: object

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:
  • self (AnySElement) –

  • pend_IDs (List[int]) –

Return type:

AnySElement

classmethod decode(elem_dat)#

Initialise a StoreElement from store element data

Parameters:

elem_dat (Dict) –

Return type:

StoreElement

encode()#

Prepare store element data for the persistent store.

Return type:

Dict

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.