matflow.Element#
- class matflow.Element(id_, is_pending, task, index, es_idx, seq_idx, src_idx, iteration_IDs, iterations)#
Bases:
Element
A basic component of a workflow. Elements are enactments of tasks.
- Parameters:
id (int) – The ID of this element.
is_pending (bool) – Whether this element is pending execution.
task (WorkflowTask) – The task this is part of the enactment of.
index (int) – The index of this element.
es_idx (int) – The index within the task of the element set containing this element.
iterations (list[dict]) – Data for creating iteration objects.
id_ (int) –
Methods
Get element data of the most recent iteration from the persistent store.
Get EARs that the most recent iteration of this element depends on.
Get the data index of the most recent element iteration.
Get EARs that depend on the most recent iteration of this element.
Get element iterations that depend on the most recent iteration of this element.
Get elements that depend on the most recent iteration of this element.
Get downstream elements that depend on this element, including recursive dependencies.
Get tasks that depend on the most recent iteration of this element.
Get elements that the most recent iteration of this element depends on.
Get element iterations that the most recent iteration of this element depends on.
Get locally defined inputs/sequences/defaults from other tasks that this the most recent iteration of this element depends on.
"Get the parameter sources of the most recent element iteration.
Get the value of a sequence that applies.
Get tasks (insert ID or WorkflowTask objects) that the most recent iteration of this element depends on.
Initialise the loop index if necessary.
Generate lists of workflow-bound InputValues and ResourceList.
Attributes
A list of element action runs from the latest iteration, where only the final run is taken for each element action.
The actions of this element (or its most recent iteration).
The name of the directory for containing temporary files for this element.
The element set containing this element.
The index within the task of the element set containing this element.
The ID of this element.
Get the index of the element within the task.
The input files to this element (or its most recent iteration).
The input source indices.
The sources of the inputs to this element.
The inputs to this element (or its most recent iteration).
Whether this element is pending execution.
The IDs of the iterations of this element.
The iterations of this element.
The most recent iteration of this element.
The output files from this element (or its most recent iteration).
The outputs from this element (or its most recent iteration).
The schema-defined parameters to this element (or its most recent iteration).
The sequence index IDs.
The task this is part of the enactment of.
The workflow containing this element.
- property action_runs: List[ElementActionRun]#
A list of element action runs from the latest iteration, where only the final run is taken for each element action.
- property actions: Dict[app.ElementAction]#
The actions of this element (or its most recent iteration).
- app = App(name='MatFlow', version='0.3.0a131')#
- property dir_name#
The name of the directory for containing temporary files for this element.
- property element_set#
The element set containing this element.
- property element_set_idx: int#
The index within the task of the element set containing this element.
- get(path=None, action_idx=None, run_idx=-1, default=None, raise_on_missing=False, raise_on_unset=False)#
Get element data of the most recent iteration from the persistent store.
- get_EAR_dependencies(as_objects=False)#
Get EARs that the most recent iteration of this element depends on.
- Parameters:
as_objects (bool) –
- Return type:
- get_data_idx(path=None, action_idx=None, run_idx=-1)#
Get the data index of the most recent element iteration.
- get_dependent_EARs(as_objects=False)#
Get EARs that depend on the most recent iteration of this element.
- Parameters:
as_objects (bool) –
- Return type:
- get_dependent_element_iterations(as_objects=False)#
Get element iterations that depend on the most recent iteration of this element.
- Parameters:
as_objects (bool) –
- Return type:
- get_dependent_elements(as_objects=False)#
Get elements that depend on the most recent iteration of this element.
- get_dependent_elements_recursively(task_insert_ID=None)#
Get downstream elements that depend on this element, including recursive dependencies.
Dependencies are resolved using the initial iteration only. This method is used to identify from which element in the previous iteration a new iteration should be parametrised.
- Parameters:
task_insert_ID – If specified, only return elements from this task.
- get_dependent_tasks(as_objects=False)#
Get tasks that depend on the most recent iteration of this element.
- Parameters:
as_objects (bool) –
- Return type:
List[int | WorkflowTask]
- get_element_dependencies(as_objects=False)#
Get elements that the most recent iteration of this element depends on.
- get_element_iteration_dependencies(as_objects=False)#
Get element iterations that the most recent iteration of this element depends on.
- Parameters:
as_objects (bool) –
- Return type:
- get_input_dependencies()#
Get locally defined inputs/sequences/defaults from other tasks that this the most recent iteration of this element depends on.
- get_parameter_sources(path=None, action_idx=None, run_idx=-1, typ=None, as_strings=False, use_task_index=False)#
“Get the parameter sources of the most recent element iteration.
- get_sequence_value(sequence_path)#
Get the value of a sequence that applies.
- get_task_dependencies(as_objects=False)#
Get tasks (insert ID or WorkflowTask objects) that the most recent iteration of this element 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: int#
Get the index of the element within the task.
Note: the global_idx attribute returns the index of the element within the workflow, across all tasks.
- property input_files: ElementInputFiles#
The input files to this element (or its most recent iteration).
- property input_sources: Dict[str, InputSource]#
The sources of the inputs to this element.
- property inputs: ElementInputs#
The inputs to this element (or its most recent iteration).
- property iterations: List[ElementIteration]#
The iterations of this element.
- property latest_iteration#
The most recent iteration of this element.
- property output_files: ElementOutputFiles#
The output files from this element (or its most recent iteration).
- property outputs: ElementOutputs#
The outputs from this element (or its most recent iteration).
- property schema_parameters: List[str]#
The schema-defined parameters to this element (or its most recent iteration).
- property task: WorkflowTask#
The task this is part of the enactment of.
- to_element_set_data()#
Generate lists of workflow-bound InputValues and ResourceList.