diff --git a/electronicparsers/ams/parser.py b/electronicparsers/ams/parser.py index a7073b34..848f6561 100644 --- a/electronicparsers/ams/parser.py +++ b/electronicparsers/ams/parser.py @@ -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(): diff --git a/electronicparsers/castep/parser.py b/electronicparsers/castep/parser.py index b9f00e77..5cb58a5a 100644 --- a/electronicparsers/castep/parser.py +++ b/electronicparsers/castep/parser.py @@ -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 diff --git a/electronicparsers/quantumespresso/parser.py b/electronicparsers/quantumespresso/parser.py index 624974e4..a5c6bd06 100644 --- a/electronicparsers/quantumespresso/parser.py +++ b/electronicparsers/quantumespresso/parser.py @@ -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)