hpcflow.app.OutputFileParser#
- class hpcflow.app.OutputFileParser(output_files, output=None, script=None, environment=None, inputs=None, outputs=None, options=None, script_pass_env_spec=False, abortable=False, save_files=True, clean_up=<factory>, rules=<factory>)#
Bases:
OutputFileParser
Represents a script that is run to parse output files from an action and create outputs.
- Parameters:
output_files (list[FileSpec]) – The output files that this parser will parse.
output (Parameter) – The singular output parsed by this parser. Not to be confused with outputs (plural).
script (str) – The name of the file containing the output file parser source.
environment (Environment) – The environment to use to run the parser.
outputs (list[str]) – Optional multiple outputs from the upstream actions of the schema that are required to parametrise this parser.
options (dict) – Miscellaneous options.
script_pass_env_spec (bool) – Whether to pass the environment specifier to the script.
abortable (bool) – Whether this script can be aborted.
save_files (list[str]) – The files that should be saved to the persistent store for the workflow.
clean_files (list[str]) – The files that should be immediately removed.
rules (list[ActionRule]) – Rules for whether to enable this parser.
Methods
Generate the file contents of this output file parser source.
Make an instance of this class from JSON (or YAML) data.
Get the rules that allow testing if this output file parser must be run or not for a given element.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Write the actual output parser to a file so it can be enacted.
Attributes
Whether this script can be aborted.
The environment to use to run the parser.
The other inputs to the parser.
Miscellaneous options.
The singular output parsed by this parser.
Optional multiple outputs from the upstream actions of the schema that are required to parametrise this parser.
The files that should be saved to the persistent store for the workflow.
The name of the file containing the output file parser source.
Whether to pass the environment specifier to the script.
The output files that this parser will parse.
The files that should be immediately removed.
Rules for whether to enable this parser.
- compose_source(snip_path)#
Generate the file contents of this output file parser source.
- environment: Environment | None = None#
The environment to use to run the parser.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- get_action_rules()#
Get the rules that allow testing if this output file parser must be run or not for a given element.
- Return type:
- output: Parameter | None = None#
The singular output parsed by this parser. Not to be confused with
outputs
(plural).
- outputs: list[str] | None = None#
Optional multiple outputs from the upstream actions of the schema that are required to parametrise this parser. Not to be confused with
output
(plural).
- rules: list[ActionRule]#
Rules for whether to enable this parser.
- save_files: InitVar[list[FileSpec] | bool] = True#
The files that should be saved to the persistent store for the workflow.
- 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.