hpcflow.app.make_workflow#

hpcflow.app.make_workflow(template_file_or_str, is_string=False, template_format=None, path=None, name=None, name_add_timestamp=True, name_use_dir=False, overwrite=False, store='zarr', ts_fmt=None, ts_name_fmt=None, store_kwargs=None, variables=None, status=True, add_submission=False)#

Generate a new hpcFlow workflow from a file or string containing a workflow template parametrisation.

Parameters:
  • template_path_or_str – Either a path to a template file in YAML or JSON format, or a YAML/JSON string.

  • is_string (bool) – Determines if passing a file path or a string.

  • template_format (Literal['json', 'yaml'] | None) – If specified, one of “json” or “yaml”. This forces parsing from a particular format.

  • path (PathLike) – The directory in which the workflow will be generated. If not specified, the config item default_workflow_path will be used; if that is not set, the current directory is used.

  • name (str | None) – The name to use for the workflow. If not provided, the name will be set to that of the template (optionally suffixed by a date-timestamp if name_add_timestamp is True).

  • name_add_timestamp (bool) – If True, suffix the name with a date-timestamp.

  • name_use_dir (bool) – If True, and name_add_timestamp is also True, the workflow directory name will be just the date-timestamp, and will be contained within a parent directory corresponding to the workflow name.

  • overwrite (bool) – If True and the workflow directory (path + name) already exists, the existing directory will be overwritten.

  • store (str) – The persistent store type to use.

  • ts_fmt (str | None) – The datetime format to use for storing datetimes. Datetimes are always stored in UTC (because Numpy does not store time zone info), so this should not include a time zone name.

  • ts_name_fmt (str | None) – The datetime format to use when generating the workflow name, where it includes a timestamp.

  • store_kwargs (dict[str, Any] | None) – Keyword arguments to pass to the store’s write_empty_workflow method.

  • variables (dict[str, str] | None) – String variables to substitute in template_file_or_str.

  • status (bool) – If True, display a live status to track workflow creation progress.

  • add_submission (bool) – If True, add a submission to the workflow (but do not submit).

  • template_file_or_str (PathLike | str)

Returns:

  • Workflow – The created workflow, if add_submission is False.

  • Submission – The created submission object, if add_submission is True.

Return type:

_Workflow | _Submission | None