From 2962b6c764b7ba923e48c985f28219e052af77db Mon Sep 17 00:00:00 2001 From: "nathan.daelman@physik.hu-berlin.de" Date: Mon, 13 Nov 2023 10:18:09 +0100 Subject: [PATCH] - Update parser mapping of `CoreHole`, `AtomParameters`, and `System` - TODO: Make sure `AtomParameters.core_hole` also displays on the GUI side, not just the archive --- electronicparsers/vasp/parser.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/electronicparsers/vasp/parser.py b/electronicparsers/vasp/parser.py index cfc3eff1..306a1db8 100644 --- a/electronicparsers/vasp/parser.py +++ b/electronicparsers/vasp/parser.py @@ -1391,11 +1391,23 @@ def parse_corehole(self) -> (Union[CoreHole, None], Union[AtomsGroup, None], int elem_label = self.parser.atom_info['atomtypes']['element'][elem_id] elem_ids = [int(x) for x in self.parser.atom_info['atomtypes']['atomspertype']] atom_ids = list(range(elem_ids[max(0, elem_id - 1)] - 1, elem_ids[elem_id])) + sub_groups = [ + AtomsGroup( + label='core-hole', + type='atom', + atom_indices=i, + n_atoms=1, + composition_formula=elem_label, + is_molecule=False, + ) + for i in atom_ids + ] atoms_group = AtomsGroup( label='core-hole_' + elem_label, type='core_hole', atom_indices=atom_ids, n_atoms=len(atom_ids), + atoms_group=sub_groups, ) return ( @@ -1483,6 +1495,7 @@ def parse_method(self) -> dict[str, Any]: core_hole, corehole_group, corehole_id = self.parse_corehole() sec_method.atom_parameters[corehole_id].core_hole = core_hole + self.logger.info(f'CH: {core_hole}, ID: {corehole_id}, AP: {sec_method.atom_parameters[corehole_id]}') sec_method.electrons_representation = [ BasisSetContainer(