Skip to content

Commit

Permalink
- Update parser mapping of CoreHole, AtomParameters, and System
Browse files Browse the repository at this point in the history
- TODO: Make sure `AtomParameters.core_hole` also displays on the GUI side, not just the archive
  • Loading branch information
[email protected] committed Nov 13, 2023
1 parent 6d05246 commit 2962b6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions electronicparsers/vasp/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 2962b6c

Please sign in to comment.