hpcflow.app.OutputFileParserSource#
- class hpcflow.app.OutputFileParserSource(parser, path=None, contents=None, extension='')#
Bases:
OutputFileParserSource
The source of code for use in an output file parser.
- Parameters:
parser (OutputFileParser) – How to parse the file.
path (Path) – Path to the file to parse.
contents (str | None) – Contents of the file. Only used when recreating this object.
extension (str) – File name extension.
Methods
Make an instance of this class from JSON (or YAML) data.
Save to a persistent workflow.
Get the actual contents of the file.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
The contents of the file.
The extension of the file.
Full workflow value path to the file.
The path to the file.
Whether the file's contents are stored in the workflow's persistent store.
The owning workflow.
How to parse the file.
What file is this? Only if known.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- Parameters:
json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.
shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.
- Return type:
The deserialised object.
- make_persistent(workflow, source)#
Save to a persistent workflow.
- property normalised_path: str#
Full workflow value path to the file.
Note
This is not the same as the path in the filesystem, but is closely related.
- parser#
How to parse the file.
- property store_contents: Any#
Whether the file’s contents are stored in the workflow’s persistent store.
- 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.