hpcflow.sdk.core.element.ElementIteration#
- class hpcflow.sdk.core.element.ElementIteration(id_, is_pending, index, element, data_idx, EARs_initialised, EAR_IDs, EARs, schema_parameters, loop_idx)#
Bases:
object
A particular iteration of an element.
- Parameters:
id (int) – The ID of this iteration.
is_pending (bool) – Whether this iteration is pending execution.
index (int) – The index of this iteration in its parent element.
element (Element) – The element this is an iteration of.
data_idx (dict) – The overall element iteration data index, before resolution of EARs.
EARs_initialised (bool) – Whether EARs have been set up for the iteration.
EAR_IDs (dict[int, int]) – Mapping from iteration number to EAR ID, where known.
loop_idx (dict[str, int]) – Indexing information from the loop.
id_ (int) –
Methods
Get element data from the persistent store.
Get EARs that this element iteration depends on (excluding EARs of this element iteration).
Get the data index.
Get EARs of downstream iterations and tasks that depend on this element iteration.
Get elements iterations of downstream iterations and tasks that depend on this element iteration.
Get elements of downstream tasks that depend on this element iteration.
Get downstream tasks that depend on this element iteration.
Get elements that this element iteration depends on.
Get element iterations that this element iteration depends on.
Get locally defined inputs/sequences/defaults from other tasks that this element iteration depends on.
Get parameter types associated with a given prefix.
Get the origin of parameters.
Resolve specific resources for the specified action of this iteration, considering all applicable scopes.
Get the resources for an action (see
get_resources()
) as a searchable model.Get tasks (insert ID or WorkflowTask objects) that this element iteration depends on.
Get template-level resources.
Attributes
Mapping from iteration number to EAR ID, where known.
The EAR IDs.
Whether or not the EARs have been initialised.
A list of element action runs, where only the final run is taken for each element action.
The actions of this iteration.
The overall element iteration data index, before resolution of EARs.
The element this is an iteration of.
The ID of this iteration.
The index of this iteration in its parent element.
The input files to this element.
The inputs to this element.
Whether this iteration is pending execution.
Indexing information from the loop.
The output files from this element.
The outputs from this element.
Parameters from the schema.
The task this is an iteration of an element for.
The workflow this is a part of.
- property EAR_IDs_flat#
The EAR IDs.
- property EARs_initialised#
Whether or not the EARs have been initialised.
- property action_runs: List[ElementActionRun]#
A list of element action runs, where only the final run is taken for each element action.
- property actions: Dict[app.ElementAction]#
The actions of this iteration.
- property data_idx#
The overall element iteration data index, before resolution of EARs.
- property element#
The element this is an iteration of.
- get(path=None, action_idx=None, run_idx=-1, default=None, raise_on_missing=False, raise_on_unset=False)#
Get element data from the persistent store.
- get_EAR_dependencies(as_objects=False)#
Get EARs that this element iteration depends on (excluding EARs of this element iteration).
- Parameters:
as_objects (bool | None) –
- Return type:
- get_data_idx(path=None, action_idx=None, run_idx=-1)#
Get the data index.
- get_dependent_EARs(as_objects=False)#
Get EARs of downstream iterations and tasks that depend on this element iteration.
- Parameters:
as_objects (bool) –
- Return type:
- get_dependent_element_iterations(as_objects=False)#
Get elements iterations of downstream iterations and tasks that depend on this element iteration.
- Parameters:
as_objects (bool) –
- Return type:
- get_dependent_elements(as_objects=False)#
Get elements of downstream tasks that depend on this element iteration.
- get_dependent_tasks(as_objects=False)#
Get downstream tasks that depend on this element iteration.
- Parameters:
as_objects (bool) –
- Return type:
List[int | WorkflowTask]
- get_element_dependencies(as_objects=False)#
Get elements that this element iteration depends on.
- get_element_iteration_dependencies(as_objects=False)#
Get element iterations that this element iteration depends on.
- Parameters:
as_objects (bool) –
- Return type:
- get_input_dependencies()#
Get locally defined inputs/sequences/defaults from other tasks that this element iteration depends on.
- get_parameter_names(prefix)#
Get parameter types associated with a given prefix.
For example, with the prefix “inputs”, this would return [‘p1’, ‘p2’] for a task schema that has input types p1 and p2. For inputs, labels are ignored. For example, for a task schema that accepts two inputs of the same type p1, with labels one and two, this method would return (for the “inputs” prefix): [‘p1[one]’, ‘p1[two]’].
This method is distinct from Action.get_parameter_names in that it returns schema-level inputs/outputs, whereas Action.get_parameter_names returns action-level input/output/file types/labels.
- get_parameter_sources(path=None, action_idx=None, run_idx=-1, typ=None, as_strings=False, use_task_index=False)#
Get the origin of parameters.
- get_resources(action, set_defaults=False)#
Resolve specific resources for the specified action of this iteration, considering all applicable scopes.
- get_resources_obj(action, set_defaults=False)#
Get the resources for an action (see
get_resources()
) as a searchable model.- Parameters:
- Return type:
- get_task_dependencies(as_objects=False)#
Get tasks (insert ID or WorkflowTask objects) that this element iteration depends on.
Dependencies may come from either elements from upstream tasks, or from locally defined inputs/sequences/defaults from upstream tasks.
- Parameters:
as_objects (bool) –
- Return type:
List[int | WorkflowTask]
- property index#
The index of this iteration in its parent element.
- property input_files: ElementInputFiles#
The input files to this element.
- property inputs: ElementInputs#
The inputs to this element.
- property output_files: ElementOutputFiles#
The output files from this element.
- property outputs: ElementOutputs#
The outputs from this element.
- property task#
The task this is an iteration of an element for.
- property workflow#
The workflow this is a part of.