matflow.WorkflowLoop#

class matflow.WorkflowLoop(index, workflow, template, num_added_iterations, iterable_parameters, parents)#

Bases: WorkflowLoop

Class to represent a Loop that is bound to a Workflow.

Parameters:
  • index (int) – The index of this loop in the workflow.

  • workflow (Workflow) – The workflow containing this loop.

  • template (Loop) – The loop that this was generated from.

  • num_added_iterations (Dict[Tuple[int], int]) – Description of what iterations have been added.

  • iterable_parameters (Dict[int:List[int, List[int]]]) – Description of what parameters are being iterated over.

  • parents (list[str]) – The paths to the parent entities of this loop.

Methods

add_iteration

Add an iteration to this loop.

get_child_loops

Get loops whose task subset is a subset of this loop's task subset.

get_parent_loops

Get loops whose task subset is a superset of this loop's task subset.

new_empty_loop

Make a new empty loop.

test_termination

Check if a loop should terminate, given the specified completed element iteration.

Attributes

app

downstream_tasks

Tasks that are not part of the loop, and downstream from this loop.

index

The index of this loop within its workflow.

iterable_parameters

The parameters that are being iterated over.

name

The name of this loop, if one is defined.

num_added_iterations

The number of added iterations.

num_iterations

The number of iterations.

parents

The parents of this loop.

task_indices

The list of task indices that define the extent of the loop.

task_insert_IDs

The insertion IDs of the tasks inside this loop.

task_objects

The tasks in this loop.

template

The loop template for this loop.

upstream_tasks

Tasks that are not part of the loop, and upstream from this loop.

workflow

The workflow containing this loop.

add_iteration(parent_loop_indices=None, cache=None)#

Add an iteration to this loop.

Parameters:
  • parent_loop_indices – Where have any parent loops got up to?

  • cache (LoopCache | None) – A cache used to make adding the iteration more efficient. One will be created if it is not supplied.

app = App(name='MatFlow', version='0.3.0a131')#
property downstream_tasks: List[WorkflowLoop]#

Tasks that are not part of the loop, and downstream from this loop.

get_child_loops()#

Get loops whose task subset is a subset of this loop’s task subset. If two loops have identical task subsets, the first loop in the workflow loop list is considered the child.

Return type:

List[WorkflowLoop]

get_parent_loops()#

Get loops whose task subset is a superset of this loop’s task subset. If two loops have identical task subsets, the first loop in the workflow loop list is considered the child.

Return type:

List[WorkflowLoop]

property index#

The index of this loop within its workflow.

property iterable_parameters#

The parameters that are being iterated over.

property name#

The name of this loop, if one is defined.

classmethod new_empty_loop(index, workflow, template, iter_loop_idx)#

Make a new empty loop.

Parameters:
  • index (int) – The index of the loop to create.

  • workflow (Workflow) – The workflow that will contain the loop.

  • template (Loop) – The template for the loop.

  • iter_loop_idx (list[dict]) – Iteration information from parent loops.

Return type:

Tuple[WorkflowLoop, List[Dict[str, int]]]

property num_added_iterations#

The number of added iterations.

property num_iterations#

The number of iterations.

property parents: List[str]#

The parents of this loop.

property task_indices: Tuple[int]#

The list of task indices that define the extent of the loop.

property task_insert_IDs#

The insertion IDs of the tasks inside this loop.

property task_objects#

The tasks in this loop.

property template#

The loop template for this loop.

test_termination(element_iter)#

Check if a loop should terminate, given the specified completed element iteration.

property upstream_tasks: List[WorkflowLoop]#

Tasks that are not part of the loop, and upstream from this loop.

property workflow#

The workflow containing this loop.