matflow.Loop#
- class matflow.Loop(tasks, num_iterations, name=None, non_iterable_parameters=None, termination=None, termination_task=None)#
Bases:
Loop
A loop in a workflow template.
- Parameters:
tasks (list[int | WorkflowTask]) – List of task insert IDs or workflow tasks.
num_iterations (int) – Number of iterations to perform.
name (str) – Loop name.
non_iterable_parameters (list[str]) – Specify input parameters that should not iterate.
termination (v~hpcflow.app.Rule) – Stopping criterion, expressed as a rule.
termination_task (int | WorkflowTask) – Task at which to evaluate the termination condition.
Methods
Make an instance of this class from JSON (or YAML) data.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
The name of the loop, if one was provided.
Which parameters are not iterable.
The number of loop iterations to do.
Get the list of task insert_IDs that define the extent of the loop.
The tasks in the loop.
A termination rule for the loop, if one is provided.
The task at which the loop will terminate.
The insert ID of the task at which the loop will terminate.
The workflow template that contains this loop.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- property task_insert_IDs: tuple[int, ...]#
Get the list of task insert_IDs that define the extent of the loop.
- property task_objects: tuple[WorkflowTask, ...]#
The tasks in the loop.
- property termination_task: WorkflowTask#
The task at which the loop will terminate.
- property termination_task_insert_ID: int#
The insert ID of the task at which the loop will terminate.
- to_json_like(dct=None, shared_data=None, exclude=(), path=None)#
Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.
- property workflow_template: WorkflowTemplate | None#
The workflow template that contains this loop.