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 aWorkflow
.- 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 an iteration to this loop.
Get loops whose task subset is a subset of this loop's task subset.
Get loops whose task subset is a superset of this loop's task subset.
Make a new empty loop.
Check if a loop should terminate, given the specified completed element iteration.
Attributes
Tasks that are not part of the loop, and downstream from this loop.
The index of this loop within its workflow.
The parameters that are being iterated over.
The name of this loop, if one is defined.
The number of added iterations.
The number of iterations.
The parents of this loop.
The list of task indices that define the extent of the loop.
The insertion IDs of the tasks inside this loop.
The tasks in this loop.
The loop template for this loop.
Tasks that are not part of the loop, and upstream from this loop.
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.0a132')#
- 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:
- 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:
- 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.
- property num_added_iterations#
The number of added iterations.
- property num_iterations#
The number of iterations.
- 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.