def parse_cif_structure(self):
        """Parse a `StructureData` from the cleaned `CifData` returned by the `CifSelectCalculation`."""
        from aiida_codtools.workflows.functions.primitive_structure_from_cif import primitive_structure_from_cif

        if self.ctx.cif.has_unknown_species:
            self.ctx.exit_code = self.exit_codes.ERROR_CIF_HAS_UNKNOWN_SPECIES
            self.report(self.ctx.exit_code.message)
            return

        if self.ctx.cif.has_undefined_atomic_sites:
            self.ctx.exit_code = self.exit_codes.ERROR_CIF_HAS_UNDEFINED_ATOMIC_SITES
            self.report(self.ctx.exit_code.message)
            return

        if self.ctx.cif.has_attached_hydrogens:
            self.ctx.exit_code = self.exit_codes.ERROR_CIF_HAS_ATTACHED_HYDROGENS
            self.report(self.ctx.exit_code.message)
            return

        parse_inputs = {
            'cif': self.ctx.cif,
            'parse_engine': self.inputs.parse_engine,
            'site_tolerance': self.inputs.site_tolerance,
            'symprec': self.inputs.symprec,
        }

        try:
            structure, node = primitive_structure_from_cif.run_get_node(**parse_inputs)
        except Exception:  # pylint: disable=broad-except
            self.ctx.exit_code = self.exit_codes.ERROR_CIF_STRUCTURE_PARSING_FAILED
            self.report(self.ctx.exit_code.message)
            return

        if node.is_failed:
            self.ctx.exit_code = self.exit_codes(node.exit_status)  # pylint: disable=too-many-function-args
            self.report(self.ctx.exit_code.message)
        else:
            self.ctx.structure = structure
def parse_cif_structure ( self ) : from aiida_codtools . workflows . functions . primitive_structure_from_cif import primitive_structure_from_cif if self . ctx . cif . has_unknown_species : self . ctx . exit_code = self . exit_codes . ERROR_CIF_HAS_UNKNOWN_SPECIES self . report ( self . ctx . exit_code . message ) return if self . ctx . cif . has_undefined_atomic_sites : self . ctx . exit_code = self . exit_codes . ERROR_CIF_HAS_UNDEFINED_ATOMIC_SITES self . report ( self . ctx . exit_code . message ) return if self . ctx . cif . has_attached_hydrogens : self . ctx . exit_code = self . exit_codes . ERROR_CIF_HAS_ATTACHED_HYDROGENS self . report ( self . ctx . exit_code . message ) return parse_inputs = { 'cif' : self . ctx . cif , 'parse_engine' : self . inputs . parse_engine , 'site_tolerance' : self . inputs . site_tolerance , 'symprec' : self . inputs . symprec , } try : structure , node = primitive_structure_from_cif . run_get_node ( ** parse_inputs ) except Exception : self . ctx . exit_code = self . exit_codes . ERROR_CIF_STRUCTURE_PARSING_FAILED self . report ( self . ctx . exit_code . message ) return if node . is_failed : self . ctx . exit_code = self . exit_codes ( node . exit_status ) self . report ( self . ctx . exit_code . message ) else : self . ctx . structure = structure
Parse a `StructureData` from the cleaned `CifData` returned by the `CifSelectCalculation`.