hpcflow.app.WorkflowTemplate#
- class hpcflow.app.WorkflowTemplate(name, doc=None, tasks=<factory>, loops=<factory>, workflow=None, resources=None, source_file=None, store_kwargs=<factory>, merge_resources=True)#
Bases:
WorkflowTemplate
Class to represent initial parametrisation of a hpcFlow workflow, with limited validation logic.
- Parameters:
name (str) – A string name for the workflow. By default this name will be used in combination with a date-time stamp when generating a persistent workflow from the template.
tasks (List[hpcflow.app.Task] | None) – A list of Task objects to include in the workflow.
loops (List[hpcflow.app.Loop] | None) – A list of Loop objects to include in the workflow.
resources (Dict[str, Dict] | None) – Template-level resources to apply to all tasks as default values. This can be a dict that maps action scopes to resources (e.g. {“any”: {“num_cores”: 2}}) or a list of ResourceSpec objects, or a ResourceList object.
merge_resources (bool | None) – If True, merge template-level resources into element set resources. If False, template-level resources are ignored.
workflow (Workflow | None) –
source_file (str | None) –
store_kwargs (Dict | None) –
Methods
Load from a JSON file.
Load from a JSON string.
Load from a YAML file.
Load from a YAML string.
Load from either a YAML or JSON file, depending on the file extension.
Attributes
- app = BaseApp(name='hpcFlow', version='0.2.0a137')#
- classmethod from_JSON_file(path)#
Load from a JSON file.
- Parameters:
path (PathLike) – The path to the JSON file containing the workflow template parametrisation.
- Return type:
- classmethod from_JSON_string(string)#
Load from a JSON string.
- Parameters:
string (str) – The JSON string containing the workflow template parametrisation.
- Return type:
- classmethod from_YAML_file(path)#
Load from a YAML file.
- Parameters:
path (PathLike) – The path to the YAML file containing the workflow template parametrisation.
- Return type:
- classmethod from_YAML_string(string)#
Load from a YAML string.
- Parameters:
string (str) – The YAML string containing the workflow template parametrisation.
- Return type:
- classmethod from_file(path, template_format=None)#
Load from either a YAML or JSON file, depending on the file extension.
- Parameters:
path (PathLike) – The path to the file containing the workflow template parametrisation.
template_format (str | None) – The file format to expect at path. One of “json” or “yaml”, if specified. By default, “yaml”.
- Return type:
- classmethod from_json_like(json_like, shared_data=None)#
- Parameters:
json_like (Union[Dict, List]) –
shared_data (Optional[Dict[str, ObjectList]]) –
- to_dict()#
- to_json_like(dct=None, shared_data=None, exclude=None, path=None)#
- workflow: app.Workflow | None = None#