matflow.Element#

class matflow.Element(id_, is_pending, task, index, es_idx, seq_idx, src_idx, iteration_IDs, iterations)#

Bases: Element

Methods

get

Get element data of the most recent iteration from the persistent store.

get_EAR_dependencies

Get EARs that the most recent iteration of this element depends on.

get_data_idx

Get the data index of the most recent element iteration.

get_dependent_EARs

Get EARs that depend on the most recent iteration of this element.

get_dependent_element_iterations

Get element iterations that depend on the most recent iteration of this element.

get_dependent_elements

Get elements that depend on the most recent iteration of this element.

get_dependent_elements_recursively

Get downstream elements that depend on this element, including recursive dependencies.

get_dependent_tasks

Get tasks that depend on the most recent iteration of this element.

get_element_dependencies

Get elements that the most recent iteration of this element depends on.

get_element_iteration_dependencies

Get element iterations that the most recent iteration of this element depends on.

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

"Get the parameter sources of the most recent element iteration.

get_sequence_value

get_task_dependencies

Get tasks (insert ID or WorkflowTask objects) that the most recent iteration of this element depends on.

init_loop_index

to_element_set_data

Generate lists of workflow-bound InputValues and ResourceList.

Attributes

action_runs

Get a list of element action runs from the latest iteration, where only the final run is taken for each element action.

actions

app

dir_name

element_set

element_set_idx

id_

index

Get the index of the element within the task.

input_files

input_source_idx

input_sources

inputs

is_pending

iteration_IDs

iterations

latest_iteration

output_files

outputs

schema_parameters

sequence_idx

task

workflow

Parameters:
  • id_ (int) –

  • is_pending (bool) –

  • task (app.WorkflowTask) –

  • index (int) –

  • es_idx (int) –

  • seq_idx (Dict[str, int]) –

  • src_idx (Dict[str, int]) –

  • iteration_IDs (List[int]) –

  • iterations (List[Dict]) –

property action_runs: List[ElementActionRun]#

Get 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]#
app = App(name='MatFlow', version='0.3.0a129')#
property dir_name#
property element_set#
property element_set_idx: int#
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.

Parameters:
  • path (str) –

  • action_idx (int) –

  • run_idx (int) –

  • default (Any) –

  • raise_on_missing (bool) –

  • raise_on_unset (bool) –

Return type:

Any

get_EAR_dependencies(as_objects=False)#

Get EARs that the most recent iteration of this element depends on.

Parameters:

as_objects (bool) –

Return type:

List[int | ElementActionRun]

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

Get the data index of the most recent element iteration.

Parameters:
  • action_idx (int) – The index of the action within the schema.

  • path (str) –

  • run_idx (int) –

Return type:

Dict[str, int]

get_dependent_EARs(as_objects=False)#

Get EARs that depend on the most recent iteration of this element.

Parameters:

as_objects (bool) –

Return type:

List[int | ElementActionRun]

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:

List[int | ElementIteration]

get_dependent_elements(as_objects=False)#

Get elements that depend on the most recent iteration of this element.

Parameters:

as_objects (bool) –

Return type:

List[int | 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.

Parameters:

as_objects (bool) –

Return type:

List[int | Element]

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:

List[int | ElementIteration]

get_input_dependencies()#

Get locally defined inputs/sequences/defaults from other tasks that this the most recent iteration of this element depends on.

Return type:

Dict[str, Dict]

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.

Parameters:
  • use_task_index (bool) – If True, use the task index within the workflow, rather than the task insert ID.

  • path (str) –

  • action_idx (int) –

  • run_idx (int) –

  • typ (str) –

  • as_strings (bool) –

Return type:

Dict[str, str | Dict[str, Any]]

get_sequence_value(sequence_path)#
Parameters:

sequence_path (str) –

Return type:

Any

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 id_: int#
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.

init_loop_index(loop_name)#
Parameters:

loop_name (str) –

property input_files: ElementInputFiles#
property input_source_idx: Dict[str, int]#
property input_sources: Dict[str, InputSource]#
property inputs: ElementInputs#
property is_pending: bool#
property iteration_IDs: List[int]#
property iterations: Dict[app.ElementAction]#
property latest_iteration#
property output_files: ElementOutputFiles#
property outputs: ElementOutputs#
property schema_parameters: List[str]#
property sequence_idx: Dict[str, int]#
property task: WorkflowTask#
to_element_set_data()#

Generate lists of workflow-bound InputValues and ResourceList.

property workflow: Workflow#