hpcflow.sdk.core.loop.Loop#
- class hpcflow.sdk.core.loop.Loop(tasks, num_iterations, name=None, non_iterable_parameters=None, termination=None)#
Bases:
JSONLike
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.
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 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.
- Parameters:
json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.
shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.
- Return type:
The deserialised object.
- 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.
- 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.