Skip to content

Commit

Permalink
Handle single-point calculations, as well as older VASP versions wher…
Browse files Browse the repository at this point in the history
…e the symmetry is not updated
  • Loading branch information
[email protected] committed Aug 18, 2023
1 parent 5be3342 commit 3906e81
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions electronicparsers/vasp/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,15 +1033,23 @@ def n_calculations(self):
'listgenerated': 'Line-path',
}

def _find_kpoints(self) -> list[str]:
stem = '/modeling[0]/calculation'
n_ionic_updates = len(self._get_key_values(stem).get('calculation', []))
if n_ionic_updates:
if not self._get_key_values(f'{stem}[0]/kpoints').get('kpoints', []):
return ['/modeling[0]/kpoints[0]' for _ in range(n_ionic_updates)]
return [f'{stem}[{ionic_update_index}]/kpoints[0]' for ionic_update_index in range(n_ionic_updates)]
return ['/modeling[0]/kpoints[0]'] # in case the calculation is a single-point

@property
def kpoints_info(self):
if self._kpoints_info is None:
self._kpoints_info = []

stem = f'/modeling[0]/calculation'
for calc_index in range(len(self._get_key_values(stem).get('calculation', []))):
# set stem
for kpoint_path in self._find_kpoints():
kpoint_dict = {}
kpoint_path = f'/modeling[0]/calculation[{calc_index}]/kpoints[0]'

method = self._get_key_values(f'{kpoint_path}/generation[0]/param')

Expand Down

0 comments on commit 3906e81

Please sign in to comment.