hpcflow.sdk.app.App#
- class hpcflow.sdk.app.App(*args, **kwargs)#
Bases:
BaseAppClass from which to instantiate downstream app objects (e.g. MatFlow).
Methods
Generate and save a new environment.
Cache all data files, and return their paths.
Cache all built-in programs, and return their paths.
Cache a data file and return its cached path.
Cache and retrieve the path to a data file (demo data or built-in program), according to the config or app attributes data_dir or program_dir (which are fsspec-compatible URLs), and a file key that represents the relative path of the file within the respective data directory.
Cache a built-in program and return its cached path.
Delete the contents of the demonstration data files cache directory.
Clear the known-submissions file of all submissions.
Delete the contents of the built-in program cache directory.
Delete the contents of the cache directory.
Delete the contents of the hostname-scoped cache directory.
Delete the contents of the user runtime directory.
Copy a builtin demo data or program file to the specified location, or the current directory.
Copy a demonstration data file to the specified location, or the current directory.
Copy a builtin demo workflow to the specified location.
Copy a built-in program to the specified location, or the current directory.
Retrieve a list of schedulers that are supported in principle by this operating system.
Return the full path to the config file, without loading the config.
Retrieve the local path to a cached data or builtin program file.
Get the demonstration data files manifest.
Get a dict whose keys are example data file or program names and whose values are the source files if the source file required unzipping or None otherwise.
Get the full path to an example data file in the app cache directory.
Context manager to get a (temporary) file path to an included demo workflow template.
Generate shell commands to activate the current conda-like or Python venv environment.
Get miscellaneous runtime system information.
Get a dict mapping parameter types to task schemas that input/output each parameter.
Get the full path to a built-in program in the app cache directory.
Get the built-in programs manifest.
Get an arbitrary scheduler object.
Get the shell hook string that, when executed, will initialise micromamba, mamba, or conda using the executable by which an environment is currently activated.
List available demonstration data files.
Return a list of demo workflow templates included in the app.
List available built-in program files.
Load the template component data built into the package.
Load the user's configuration.
Load a WorkflowTemplate object from a builtin demo template file.
Load all template component data, warning by default if already loaded.
Return a decorator for retrying functions on permission and OS errors that might be associated with cloud-storage desktop sync.
Retrieve existing workflows that might be running.
Reload the configuration.
Reload all template component data, warning by default if not already loaded.
Remove an environment identified by its name and specifiers, or remove all environments with a particular setup label and specifiers.
Reset the config file to defaults, and reload the config.
Save an environment to the environment definitions file.
Print the contents of a builtin demo workflow template file.
Get template components from a (simply parsed) JSON document.
Discard any loaded configuration.
Update submission records in the known-submission file.
Attributes
The logger for API messages.
ActionThe
Actionclass.ActionEnvironmentThe
ActionEnvironmentclass.ActionRuleThe
ActionRuleclass.ActionScopeThe
ActionScopeclass.ActionScopeTypeThe
ActionScopeTypeclass.The logger for CLI messages.
CommandThe
Commandclass.CommandFilesListThe
CommandFilesListclass.DirectPosixThe
DirectPosixclass.DirectWindowsThe
DirectWindowsclass.ElementThe
Elementclass.ElementActionThe
ElementActionclass.ElementActionRunThe
ElementActionRunclass.ElementFilterThe
ElementFilterclass.ElementGroupThe
ElementGroupclass.ElementInputFilesThe
ElementInputFilesclass.ElementInputsThe
ElementInputsclass.ElementIterationThe
ElementIterationclass.ElementOutputFilesThe
ElementOutputFilesclass.ElementOutputsThe
ElementOutputsclass.ElementParameterThe
ElementParameterclass.ElementPropagationThe
ElementPropagationclass.ElementResourcesThe
ElementResourcesclass.ElementSetThe
ElementSetclass.EnvironmentThe
Environmentclass.EnvironmentsListThe
EnvironmentsListclass.ExecutableThe
Executableclass.ExecutableInstanceThe
ExecutableInstanceclass.ExecutablesListThe
ExecutablesListclass.FileNameExtThe
FileNameExtclass.FileNameSpecThe
FileNameSpecclass.FileNameStemThe
FileNameStemclass.FileSpecThe
FileSpecclass.GroupListThe
GroupListclass.InputFileGeneratorThe
InputFileGeneratorclass.InputSourceThe
InputSourceclass.InputSourceTypeThe
InputSourceTypeclass.InputValueThe
InputValueclass.JobscriptThe
Jobscriptclass.LoopThe
Loopclass.MultiPathSequenceThe
MultiPathSequenceclass.NumCoresThe
NumCoresclass.OutputFileParserThe
OutputFileParserclass.ParameterThe
Parameterclass.ParameterValueThe
ParameterValueclass.ParametersThe
Parametersclass.ParametersListThe
ParametersListclass.QueuedSchedulerThe
QueuedSchedulerclass.ResourceListThe
ResourceListclass.ResourceSpecThe
ResourceSpecclass.RuleThe
Ruleclass.RunDirAppFilesThe
RunDirAppFilesclass.SGEPosixThe
SGEPosixclass.SchemaInputThe
SchemaInputclass.SchemaOutputThe
SchemaOutputclass.SchemaParameterThe
SchemaParameterclass.SlurmPosixThe
SlurmPosixclass.SubmissionThe
Submissionclass.TaskThe
Taskclass.TaskInputParametersThe
TaskInputParametersclass.TaskListThe
TaskListclass.TaskObjectiveThe
TaskObjectiveclass.TaskOutputParametersThe
TaskOutputParametersclass.TaskSchemaThe
TaskSchemaclass.TaskSchemasListThe
TaskSchemasListclass.TaskSourceTypeThe
TaskSourceTypeclass.TaskTemplateListThe
TaskTemplateListclass.ValueSequenceThe
ValueSequenceclass.WorkflowThe
Workflowclass.WorkflowLoopThe
WorkflowLoopclass.WorkflowLoopListThe
WorkflowLoopListclass.WorkflowTaskThe
WorkflowTaskclass.WorkflowTaskListThe
WorkflowTaskListclass.WorkflowTemplateThe
WorkflowTemplateclass.Cancel the execution of a workflow submission.
The known template command files.
The configuration.
The logger for configuration messages.
A directory for demonstration data caching.
The known template execution environments.
Get information about the operating system.
Retrieve information about active and recently inactive finished workflows.
Get information about a given shell and the operating system.
Whether the configuration is loaded.
Whether any template component (e.g. parameters) has been loaded.
The known Jinja template files.
The path to the file describing known submissions.
The application log.
The main underlying logger.
Generate and submit a new demo workflow from a file or string containing a workflow template parametrisation.
Generate and submit a new workflow from a file or string containing a workflow template parametrisation.
Generate a new workflow from a builtin demo workflow template.
Generate a new workflow from a file or string containing a workflow template parametrisation.
The known template parameters.
The logger for persistence engine messages.
A directory for built-in program caching.
The known programs.
Run hpcflow test suite.
Run the test suite.
Information about the runtime.
The logger for runtime messages.
The scheduler mapping.
The known template scripts.
Show information about running workflows.
Output a legend for the jobscript-element and EAR states that are displayed by the show command.
The logger for job submission messages.
Submit an existing workflow.
The known template task schemas.
The template component data.
Whether the timing analysis system is active.
The user's cache directory.
The hostname-scoped app cache directory.
The user's data directory.
The directory for holding user data.
The user's temporary runtime directory.
The name of the application.
Name of package.
The version of the application.
The module name in which the app object is defined.
Description of the application.
Name of Github organisation responsible for the application.
Github repository containing the application source.
Configuration options.
Arguments for pytest.
Directory for scripts.
Directory for Jinja templates.
Directory for workflows.
Directory for JSON manifest files.
Directory for demonstration data.
Directory for built-in program data.
The convention for the app alias used in import statements in the documentation.
URL to documentation.
Callable that returns additional parameter encoders.
Callable that returns additional parameter decoders.
Command line interface subsystem.
Environment setup CLI, to which downstream apps can add their own commands
- Return type:
T
- property API_logger: Logger#
The logger for API messages.
- property CLI_logger: Logger#
The logger for CLI messages.
- add_env(name, setup=None, executables=None, use_current=False, **kwargs)#
Generate and save a new environment.
- cache_all_data_files(exist_ok=True)#
Cache all data files, and return their paths.
- cache_all_programs(exist_ok=True)#
Cache all built-in programs, and return their paths.
- cache_data_file(file_key, exist_ok=True)#
Cache a data file and return its cached path.
- cache_file(data_type, file_key, manifest=None, exist_ok=True)#
Cache and retrieve the path to a data file (demo data or built-in program), according to the config or app attributes data_dir or program_dir (which are fsspec-compatible URLs), and a file key that represents the relative path of the file within the respective data directory.
For remote file systems, this will involve downloading the file to a temporary directory. For files that live within a zip file, as specified in the manifest, this method will first unzip the files before moving to the cache directory.
- cache_program(file_key, exist_ok=True)#
Cache a built-in program and return its cached path.
- property cancel: _Cancel#
Cancel the execution of a workflow submission.
- clear_data_cache_dir()#
Delete the contents of the demonstration data files cache directory.
- Return type:
None
- clear_known_submissions_file()#
Clear the known-submissions file of all submissions. This shouldn’t be needed normally.
- Return type:
None
- clear_program_cache_dir()#
Delete the contents of the built-in program cache directory.
- Return type:
None
- clear_user_cache_dir()#
Delete the contents of the cache directory.
- Return type:
None
- clear_user_cache_hostname_dir()#
Delete the contents of the hostname-scoped cache directory.
- Return type:
None
- clear_user_runtime_dir()#
Delete the contents of the user runtime directory.
- Return type:
None
- cli#
Command line interface subsystem.
- property command_files: _CommandFilesList#
The known template command files.
- property config_logger: Logger#
The logger for configuration messages.
- config_options#
Configuration options.
- copy_cacheable_file(data_type, file_key, dst=None)#
Copy a builtin demo data or program file to the specified location, or the current directory.
- Parameters:
data_type (Literal['data', 'program']) – Type of the data: “data” or “program”.
file_key (str) – The file key to copy.
dst (PathLike | None) – File path to copy the file to, or, if an existing directory, the parent directory to copy the source file or directory to. If not specified, the current working directory will be used. Note that if the source is a directory, this must be specified as the parent directory to copy into.
- Returns:
The new path created at or in the destination.
- Return type:
new_path
- Raises:
FileExistsError – If the source is a directory, and the destination directory already contains a directory of the same name, FileExistsError will be raised. However, if the source is a file, and the destination directory already contains a file of the same name, it will be over-written.
- copy_data_file(file_key, dst=None)#
Copy a demonstration data file to the specified location, or the current directory.
- Parameters:
file_key (str) – The file key to copy.
dst (PathLike | None) – File path to copy the file to, or, if an existing directory, the parent directory to copy the source file or directory to. If not specified, the current working directory will be used. Note that if the source is a directory, this must be specified as the parent directory to copy into.
- Returns:
The new path created at or in the destination.
- Return type:
new_path
- Raises:
FileExistsError – If the source is a directory, and the destination directory already contains a directory of the same name, FileExistsError will be raised. However, if the source is a file, and the destination directory already contains a file of the same name, it will be over-written.
- copy_demo_workflow(name, dst=None, doc=True)#
Copy a builtin demo workflow to the specified location.
- Parameters:
name (str) – The name of the demo workflow to copy
dst (PathLike | None) – Directory or full file path to copy the demo workflow to. If not specified, the current working directory will be used.
doc (bool) – If False, the copied workflow template file will not include the doc attribute (if originally present).
- Return type:
- copy_program(file_key, dst=None)#
Copy a built-in program to the specified location, or the current directory.
- Parameters:
file_key (str) – The file key to copy.
dst (PathLike | None) – File path to copy the file to, or, if an existing directory, the parent directory to copy the source file or directory to. If not specified, the current working directory will be used. Note that if the source is a directory, this must be specified as the parent directory to copy into.
- Returns:
The new path created at or in the destination.
- Return type:
new_path
- Raises:
FileExistsError – If the source is a directory, and the destination directory already contains a directory of the same name, FileExistsError will be raised. However, if the source is a file, and the destination directory already contains a file of the same name, it will be over-written.
- property data_cache_dir: Path#
A directory for demonstration data caching.
- data_dir#
Directory for demonstration data.
- data_manifest_dir#
Directory for JSON manifest files.
- decoders#
Callable that returns additional parameter decoders.
- description#
Description of the application.
- docs_import_conv#
The convention for the app alias used in import statements in the documentation.
- docs_url#
URL to documentation.
- encoders#
Callable that returns additional parameter encoders.
- env_setup_CLI#
Environment setup CLI, to which downstream apps can add their own commands
- property envs: _EnvironmentsList#
The known template execution environments.
- get_OS_supported_schedulers()#
Retrieve a list of schedulers that are supported in principle by this operating system.
This does not necessarily mean all the returned schedulers are available on this system.
- Return type:
Iterator[str]
- get_config_path(config_dir=None)#
Return the full path to the config file, without loading the config.
- Parameters:
config_dir (PathLike)
- Return type:
Path
- get_data_file_path(data_type, file_key)#
Retrieve the local path to a cached data or builtin program file.
- get_data_files_manifest()#
Get the demonstration data files manifest.
- get_data_manifest(data_type)#
Get a dict whose keys are example data file or program names and whose values are the source files if the source file required unzipping or None otherwise.
If the config items data_manifest_file/program_manifest_file is set, this is used as the manifest file path. Otherwise, the app attribute data_manifest_dir is used, and is expected to be a (fsspec-compatible) URL to a directory that contains data.json and programs.json manifest files.
- get_demo_data_file_path(file_name)#
Get the full path to an example data file in the app cache directory.
If the file does not already exist in the app cache directory, it will be added (and unzipped if required). The file may first be downloaded from a remote file system such as GitHub (see get_data_file_path for details).
- Parameters:
file_name (str)
- Return type:
Path
- get_demo_workflow_template_file(name, doc=True, delete=True)#
Context manager to get a (temporary) file path to an included demo workflow template.
- Parameters:
- Return type:
Iterator[Path]
- get_env_setup(shell)#
Generate shell commands to activate the current conda-like or Python venv environment.
- property get_known_submissions: _GetKnownSubmissions#
Retrieve information about active and recently inactive finished workflows.
This method removes workflows from the known-submissions file that are found to be inactive on this machine (according to the scheduler/process ID).
- Parameters:
- Returns:
List of descriptions of known items.
- Return type:
- get_parameter_task_schema_map()#
Get a dict mapping parameter types to task schemas that input/output each parameter.
- get_program_path(file_name)#
Get the full path to a built-in program in the app cache directory.
If the file does not already exist in the app cache directory, it will be added (and unzipped if required). The file may first be downloaded from a remote file system such as GitHub (see get_data_file_path for details).
- Parameters:
file_name (str)
- Return type:
Path
- get_scheduler(scheduler_name, os_name, scheduler_args=None)#
Get an arbitrary scheduler object.
- get_shell_hook(shell, env_info)#
Get the shell hook string that, when executed, will initialise micromamba, mamba, or conda using the executable by which an environment is currently activated.
- property get_shell_info: Callable[[str, bool], VersionInfo]#
Get information about a given shell and the operating system.
- gh_org#
Name of Github organisation responsible for the application.
- gh_repo#
Github repository containing the application source.
- property is_template_components_loaded: bool#
Whether any template component (e.g. parameters) has been loaded.
- jinja_templates_dir#
Directory for Jinja templates.
- property known_subs_file_path: Path#
The path to the file describing known submissions.
- list_demo_workflows()#
Return a list of demo workflow templates included in the app.
- classmethod load_builtin_template_component_data(package)#
Load the template component data built into the package. This is as opposed to the template components defined by users.
- Parameters:
package (ModuleType | str)
- Return type:
BasicTemplateComponents
- load_config(config_dir=None, config_key=None, warn=True, **overrides)#
Load the user’s configuration.
- load_demo_workflow(name, variables=None)#
Load a WorkflowTemplate object from a builtin demo template file.
- Parameters:
name (str) – Name of the demo workflow to load.
variables (dict[str, str] | Literal[False] | None) – String variables to substitute in the demo workflow. Substitutions will be attempted if the file looks to contain variable references (like “<<var:name>>”). If set to False, no substitutions will occur, which may result in an invalid workflow template!
- Return type:
_WorkflowTemplate
- load_template_components(warn=True)#
Load all template component data, warning by default if already loaded.
- Parameters:
warn (bool)
- Return type:
None
- property logger: Logger#
The main underlying logger.
- property make_and_submit_demo_workflow: _MakeAndSubmitDemoWorkflow#
Generate and submit a new demo workflow from a file or string containing a workflow template parametrisation.
- Parameters:
workflow_name (str) – Name of the demo workflow to make. Required.
template_format (str) – If specified, one of “json” or “yaml”. This forces parsing from a particular format.
path (str | Path) – 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) – 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. A default value can be set with the config item workflow_name_add_timestamp; otherwise set to True.
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. A default value can be set with the config item workflow_name_use_dir; otherwise set to False.
overwrite (bool) – If True and the workflow directory (path + name) already exists, the existing directory will be overwritten.
store (str) – The persistent store to use for this workflow.
ts_fmt (str) – 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) – The datetime format to use when generating the workflow name, where it includes a timestamp.
store_kwargs (dict[str, object]) – Keyword arguments to pass to the store’s write_empty_workflow method.
variables (dict[str, str]) – String variables to substitute in the demo workflow template file.
JS_parallelism (bool) – If True, allow multiple jobscripts to execute simultaneously. Raises if set to True but the store type does not support the jobscript_parallelism feature. If not set, jobscript parallelism will be used if the store type supports it.
wait (bool) – If True, this command will block until the workflow execution is complete.
add_to_known (bool) – If True, add the new submission to the known-submissions file, which is used by the show command to monitor current and recent submissions.
return_idx (bool) – If True, return a dict representing the jobscript indices submitted for each submission.
tasks (list[int]) – List of task indices to include in this submission. By default all tasks are included.
cancel (bool) – Immediately cancel the submission. Useful for testing and benchmarking.
status (bool) – If True, display a live status to track submission progress.
- Returns:
Workflow – The created workflow.
dict[int, list[int]] – Mapping of submission handles. If requested by
return_idxparameter.
- property make_and_submit_workflow: _MakeAndSubmitWorkflow#
Generate and submit a new workflow from a file or string containing a workflow template parametrisation.
- Parameters:
template_path_or_str (str) – Either a path to a template file in YAML or JSON format, or a YAML/JSON string.
is_string (str) – Determines whether template_path_or_str is a string or a file.
template_format (str) – If specified, one of “json” or “yaml”. This forces parsing from a particular format.
path (str | Path) – 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) – 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. A default value can be set with the config item workflow_name_add_timestamp; otherwise set to True.
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. A default value can be set with the config item workflow_name_use_dir; otherwise set to False.
overwrite (bool) – If True and the workflow directory (path + name) already exists, the existing directory will be overwritten.
store (str) – The persistent store to use for this workflow.
ts_fmt (str) – 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) – The datetime format to use when generating the workflow name, where it includes a timestamp.
store_kwargs (dict[str, object]) – Keyword arguments to pass to the store’s write_empty_workflow method.
variables (dict[str, str]) – String variables to substitute in template_file_or_str.
JS_parallelism (bool) – If True, allow multiple jobscripts to execute simultaneously. Raises if set to True but the store type does not support the jobscript_parallelism feature. If not set, jobscript parallelism will be used if the store type supports it.
wait (bool) – If True, this command will block until the workflow execution is complete.
add_to_known (bool) – If True, add the new submission to the known-submissions file, which is used by the show command to monitor current and recent submissions.
return_idx (bool) – If True, return a dict representing the jobscript indices submitted for each submission.
tasks (list[int]) – List of task indices to include in this submission. By default all tasks are included.
cancel (bool) – Immediately cancel the submission. Useful for testing and benchmarking.
status (bool) – If True, display a live status to track workflow creation and submission progress.
- Returns:
Workflow – The created workflow.
dict[int, list[int]] – Mapping of submission handles. If requested by
return_idxparameter.
- property make_demo_workflow: _MakeDemoWorkflow#
Generate a new workflow from a builtin demo workflow template.
- Parameters:
workflow_name (str) – Name of the demo workflow to make.
template_format (str) – If specified, one of “json” or “yaml”. This forces parsing from a particular format.
path (str | Path) – 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) – 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. A default value can be set with the config item workflow_name_add_timestamp; otherwise set to True.
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. A default value can be set with the config item workflow_name_use_dir; otherwise set to False.
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) – 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) – The datetime format to use when generating the workflow name, where it includes a timestamp.
store_kwargs (dict[str, object]) – Keyword arguments to pass to the store’s write_empty_workflow method.
variables (dict[str, str]) – String variables to substitute in the demo workflow template file.
status (bool) – If True, display a live status to track workflow creation progress.
add_submission – If True, add a submission to the workflow (but do not submit).
- Returns:
Workflow – The created workflow, if add_submission is False.
Submission – The created submission object, if add_submission is True.
- property make_workflow: _MakeWorkflow#
Generate a new workflow from a file or string containing a workflow template parametrisation.
- Parameters:
template_path_or_str (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 (str) – If specified, one of “json” or “yaml”. This forces parsing from a particular format.
path (str | Path) – 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) – 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. A default value can be set with the config item workflow_name_add_timestamp; otherwise set to True.
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. A default value can be set with the config item workflow_name_use_dir; otherwise set to False.
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) – 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) – The datetime format to use when generating the workflow name, where it includes a timestamp.
store_kwargs (dict[str, object]) – Keyword arguments to pass to the store’s write_empty_workflow method.
variables (dict[str, str]) – String variables to substitute in template_file_or_str.
status (bool) – If True, display a live status to track workflow creation progress.
add_submission – If True, add a submission to the workflow (but do not submit).
- Returns:
Workflow – The created workflow, if add_submission is False.
Submission – The created submission object, if add_submission is True.
- module#
The module name in which the app object is defined.
- name#
The name of the application.
- package_name#
Name of package.
- property parameters: _ParametersList#
The known template parameters.
- perm_error_retry()#
Return a decorator for retrying functions on permission and OS errors that might be associated with cloud-storage desktop sync. engine operations.
- property persistence_logger: Logger#
The logger for persistence engine messages.
- property program_cache_dir: Path#
A directory for built-in program caching.
- program_dir#
Directory for built-in program data.
- pytest_args#
Arguments for pytest.
- read_known_submissions_file()#
Retrieve existing workflows that might be running.
- Return type:
- static redirect_std_to_file(*args, **kwargs)#
- reload_config(config_dir=None, config_key=None, warn=True, **overrides)#
Reload the configuration. Use if a user has updated the configuration file outside the scope of this application.
- reload_template_components(warn=True)#
Reload all template component data, warning by default if not already loaded.
- Parameters:
warn (bool)
- Return type:
None
- remove_env(name=None, specifiers=None, label=None)#
Remove an environment identified by its name and specifiers, or remove all environments with a particular setup label and specifiers.
- reset_config(config_dir=None, config_key=None, warn=True, **overrides)#
Reset the config file to defaults, and reload the config.
- property run_hpcflow_tests: _RunTests#
Run hpcflow test suite. This function is only available from derived apps.
- property run_tests: _RunTests#
Run the test suite.
- property run_time_info: RunTimeInfo#
Information about the runtime.
- property runtime_info_logger: Logger#
The logger for runtime messages.
- save_env(env, env_source_file=None, file_name='configured_envs.yaml')#
Save an environment to the environment definitions file.
- Parameters:
env (Environment)
env_source_file (Path | None)
file_name (str)
- scripts_dir#
Directory for scripts.
- property show: _Show#
Show information about running workflows.
- Parameters:
- show_demo_workflow(name, syntax=True, doc=False)#
Print the contents of a builtin demo workflow template file.
- property show_legend: Callable[[], None]#
Output a legend for the jobscript-element and EAR states that are displayed by the show command.
- property submission_logger: Logger#
The logger for job submission messages.
- property submit_workflow: _SubmitWorkflow#
Submit an existing workflow.
- Parameters:
workflow_path (str) – Path to an existing workflow
JS_parallelism (bool) – If True, allow multiple jobscripts to execute simultaneously. Raises if set to True but the store type does not support the jobscript_parallelism feature. If not set, jobscript parallelism will be used if the store type supports it.
tasks (list[int]) – List of task indices to include in this submission. By default all tasks are included.
- Returns:
Mapping of submission handles. If requested by
return_idxparameter.- Return type:
- property task_schemas: _TaskSchemasList#
The known template task schemas.
- property template_components: TemplateComponents#
The template component data.
- template_components_from_json_like(json_like)#
Get template components from a (simply parsed) JSON document.
- Parameters:
- Return type:
- unload_config()#
Discard any loaded configuration.
- Return type:
None
- update_known_subs_file(inactive_IDs, start_times, end_times)#
Update submission records in the known-submission file.
Note
We aim for atomicity to help with the scenario where a new workflow submission is adding itself to the file at the same time as we have decided an existing workflow should no longer be part of this file. Ideally, such a scenario should not arise because both operations should only ever be interactively initiated by the single user (Workflow.submit and App.get_known_submissions). If this operation is atomic, then at least the known-submissions file should be left in a usable (but inaccurate) state.
- property user_cache_dir: Path#
The user’s cache directory.
- property user_cache_hostname_dir: Path#
The hostname-scoped app cache directory.
- property user_data_dir: Path#
The user’s data directory.
- property user_data_hostname_dir: Path#
The directory for holding user data.
We segregate by hostname to account for the case where multiple machines might use the same shared file system.
- property user_runtime_dir: Path#
The user’s temporary runtime directory.
- version#
The version of the application.
- workflows_dir#
Directory for workflows.