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, save_files=True, clean_up=None, rules=None)#
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 files that should be immediately removed.
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.
Rules for whether to enable 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.
- app = App(name='MatFlow', version='0.3.0a132')#
- compose_source(snip_path)#
Generate the file contents of this output file parser source.
- Return type:
- environment: Environment = 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.
- Parameters:
json_like – The data to deserialise.
shared_data – Shared context data.
- Return type:
The deserialised object.
- get_action_rules()#
Get the rules that allow testing if this output file parser must be run or not for a given element.
- options: Dict = None#
Miscellaneous options.
- output: app.Parameter | None = None#
The singular output parsed by this parser. Not to be confused with
outputs
(plural).
- output_files: List[app.FileSpec]#
The output files that this parser will parse.
- outputs: List[str] = 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).
- save_files: List[str] | bool = True#
The files that should be saved to the persistent store for the workflow.
- to_dict()#
Serialize this object as a dictionary.
- to_json_like(dct=None, shared_data=None, exclude=None, 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.