matflow.OutputFileParser#
- class matflow.OutputFileParser(output_files, output=None, script=None, environment=None, inputs=None, outputs=None, options=None, script_pass_env_spec=False, abortable=False, generates_files=<factory>, clean_up=<factory>, rules=<factory>, requires_dir=True)#
Bases:
OutputFileParserRepresents 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.
generates_files (list[FileSpec]) – Files produced by the parser script itself (as opposed to the files it parses, given by
output_files). Declaring them here makes them available asoutput_files.<label>parameters and selectable by the task schema’ssave_filespolicy.clean_up (list[FileSpec]) – Files that should be removed from the working directory once they have been saved as workflow artifacts.
rules (list[ActionRule]) – Rules for whether to enable this parser.
requires_dir (bool) –
Methods
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.
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.
Whether the parser requires a working directory.
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.
Files produced by the parser script itself.
Files to remove from the working directory once saved as artifacts.
Rules for whether to enable this parser.
- 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(singular).
- rules: list[ActionRule]#
Rules for whether to enable this parser.
- 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.