Source code for aiida_mlip.parsers.descriptors_parser
"""Parsers provided by aiida_mlip."""fromaiida.commonimportexceptionsfromaiida.orm.nodes.process.processimportProcessNodefromaiida.pluginsimportCalculationFactoryfromaiida_mlip.parsers.sp_parserimportSPParserDescriptorsCalc=CalculationFactory("mlip.descriptors")
[docs]classDescriptorsParser(SPParser):""" Parser class for parsing output of descriptors calculation. Inherits from SPParser. Parameters ---------- node : aiida.orm.nodes.process.process.ProcessNode ProcessNode of calculation. Raises ------ exceptions.ParsingError If the ProcessNode being passed was not produced by a DescriptorsCalc. """
[docs]def__init__(self,node:ProcessNode):""" Check that the ProcessNode being passed was produced by a `Descriptors`. Parameters ---------- node : aiida.orm.nodes.process.process.ProcessNode ProcessNode of calculation. """super().__init__(node)ifnotissubclass(node.process_class,DescriptorsCalc):raiseexceptions.ParsingError("Can only parse `Descriptors` calculations")