hpcflow.sdk.core.actions.ElementAction#

class hpcflow.sdk.core.actions.ElementAction(element_iteration, action_idx, runs)#

Bases: AppAware

An abstract representation of an element’s action at a particular iteration and the runs that enact that element iteration.

Parameters:
  • element_iteration (ElementIteration) – The iteration

  • action_idx (int) – The action index.

  • runs (dict[Mapping[str, Any], Any]) – The list of run indices.

Methods

get

Get the value of a parameter.

get_data_idx

Get the data index for some path/run.

get_parameter_names

Get parameter types associated with a given prefix.

get_parameter_sources

Get information about where parameters originated.

Attributes

action

The abstract task that this is a concrete model of.

action_idx

The index of the action.

element

The element for this action.

element_iteration

The iteration for this action.

input_files

The input files to this action.

inputs

The inputs to this action.

num_runs

The number of runs associated with this action.

output_files

The output files from this action.

outputs

The outputs from this action.

runs

The EARs that this action is enacted by.

task

The task that this action is an instance of.

property action: Action#

The abstract task that this is a concrete model of.

property action_idx: int#

The index of the action.

property element: Element#

The element for this action.

property element_iteration: ElementIteration#

The iteration for this action.

get(path=None, run_idx=-1, default=None, raise_on_missing=False, raise_on_unset=False)#

Get the value of a parameter.

Parameters:
  • path (str | None) –

  • run_idx (int) –

  • default (Any | None) –

  • raise_on_missing (bool) –

  • raise_on_unset (bool) –

Return type:

Any

get_data_idx(path=None, run_idx=-1)#

Get the data index for some path/run.

Parameters:
  • path (str | None) –

  • run_idx (int) –

Return type:

DataIndex

get_parameter_names(prefix)#

Get parameter types associated with a given prefix.

For inputs, labels are ignored. See Action.get_parameter_names() for more information.

Parameters:

prefix (str) – One of “inputs”, “outputs”, “input_files”, “output_files”.

Return type:

list[str]

get_parameter_sources(path: str | None = None, *, run_idx: int = -1, typ: str | None = None, as_strings: Literal[False] = False, use_task_index: bool = False) Mapping[str, ParamSource | list[ParamSource]]#
get_parameter_sources(path: str | None = None, *, run_idx: int = -1, typ: str | None = None, as_strings: Literal[True], use_task_index: bool = False) Mapping[str, str]

Get information about where parameters originated.

property input_files: ElementInputFiles#

The input files to this action.

property inputs: ElementInputs#

The inputs to this action.

property num_runs: int#

The number of runs associated with this action.

property output_files: ElementOutputFiles#

The output files from this action.

property outputs: ElementOutputs#

The outputs from this action.

property runs: list[hpcflow.sdk.core.actions.ElementActionRun]#

The EARs that this action is enacted by.

property task: WorkflowTask#

The task that this action is an instance of.