Skip to content

Commit

Permalink
Minor fix ams parser (#268)
Browse files Browse the repository at this point in the history
* Minor fix ams parser

* Linting fix
  • Loading branch information
ladinesa authored Dec 12, 2024
1 parent 84fed5d commit 6e57d16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion electronicparsers/ams/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ def parse(self, key=None):
nspin = general.get('nspin', 1)
xc_functional = {}
if (ldapot := general.get('ldapot')) is not None:
xc_functional['LDA'] = self._ldapot.get(ldapot)
xc_functional['LDA'] = self._ldapot.get(ldapot, '')
if ggapot := general.get('ggapot', '').strip():
xc_functional['GGA'] = ggapot
if mgga := general.get('MetaGGAConfig', {}).get('metagga', '').strip():
Expand Down
6 changes: 3 additions & 3 deletions electronicparsers/castep/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def add_unit(val):
elif line and last_parameter:
last_parameter[1].append(add_unit(line.strip()))

for key in title.keys():
for sub_key, val in title[key].items():
title[key][sub_key] = val[0] if len(val) == 1 else val
for key, tval in title.items():
for sub_key, val in tval.items():
tval[sub_key] = val[0] if len(val) == 1 else val

return title

Expand Down
8 changes: 4 additions & 4 deletions electronicparsers/quantumespresso/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3207,11 +3207,11 @@ def parse_configuration(calculation):
'damped_dynamics': 'geometry_optimization',
'vcs_wentzcovitch_damped_minimization': 'geometry_optimization',
}
for method in methods:
sampling = run.get(method)
for key, val in methods.items():
sampling = run.get(key)
if sampling is not None:
self.sampling_method = methods[method]
if method.startswith('vcs') and sampling.get('dynamics') is not None:
self.sampling_method = val
if key.startswith('vcs') and sampling.get('dynamics') is not None:
self.sampling_method = 'molecular_dynamics'
for calculation in sampling.get('self_consistent', []):
parse_configuration(calculation)
Expand Down

0 comments on commit 6e57d16

Please sign in to comment.