Module for classes and utilities to write parsers for calculation jobs.
Base class for a Parser that can parse the outputs produced by a CalcJob process.
Construct the Parser instance.
node – the CalcJobNode that contains the results of the executed CalcJob process.
list of weak references to the object (if defined)
Return the exit codes defined for the process class of the node being parsed.
ExitCodesNamespace of ExitCode named tuples
Return the dictionary of nodes that should be passed to the Parser.parse call.
Output nodes can be marked as being required by the parse method, by setting the pass_to_parser attribute,
in the spec.output call in the process spec of the CalcJob, to True.
dictionary of nodes that are required by the parse method
Return the logger preconfigured for the calculation node associated with this parser instance.
Return the node instance
the CalcJobNode instance
Register a node as an output with the given link label.
link_label – the name of the link label
node – the node to register as an output
aiida.common.ModificationNotAllowed – if an output node was already registered with the same link label
Return the dictionary of outputs that have been registered.
an AttributeDict instance with the registered output nodes
Parse the contents of the output files retrieved in the FolderData.
This method should be implemented in the sub class. Outputs can be registered through the out method.
After the parse call finishes, the runner will automatically link them up to the underlying CalcJobNode.
kwargs – output nodes attached to the CalcJobNode of the parser instance.
an instance of ExitCode or None
Parse the outputs directly from the CalcJobNode.
If store_provenance is set to False, a CalcFunctionNode will still be generated, but it will not be stored.
It’s storing method will also be disabled, making it impossible to store, because storing it afterwards would
not have the expected effect, as the outputs it produced will not be stored with it.
This method is useful to test parsing in unit tests where a CalcJobNode can be mocked without actually having
to run a CalcJob. It can also be useful to actually re-perform the parsing of a completed CalcJob with a
node – a CalcJobNode instance
store_provenance – bool, if True will store the parsing as a CalcFunctionNode in the provenance
retrieved_temporary_folder – absolute path to folder with contents of retrieved_temporary_list
a tuple of the parsed results and the CalcFunctionNode representing the process of parsing
This module implements a generic output plugin, that is general enough
to allow the reading of the outputs of a calculation.