From 9be703a69590b34f60fef86aa59e6622c8ae4e26 Mon Sep 17 00:00:00 2001 From: Lauri Himanen <lauri.himanen@gmail.com> Date: Thu, 7 May 2020 13:35:19 +0300 Subject: [PATCH] Better handling of missing basis set settings. --- nomad/normalizing/encyclopedia/basisset.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nomad/normalizing/encyclopedia/basisset.py b/nomad/normalizing/encyclopedia/basisset.py index 4b47063dfc..2e615c97e0 100644 --- a/nomad/normalizing/encyclopedia/basisset.py +++ b/nomad/normalizing/encyclopedia/basisset.py @@ -168,33 +168,33 @@ class BasisSetExciting(BasisSet): label = group.x_exciting_geometry_atom_labels try: muffin_tin_settings["{}_muffin_tin_radius".format(label)] = "%.6f" % (group.x_exciting_muffin_tin_radius.to(ureg.angstrom).magnitude) - except KeyError: + except Exception: muffin_tin_settings["{}_muffin_tin_radius".format(label)] = None try: muffin_tin_settings["{}_muffin_tin_points".format(label)] = "%d" % group.x_exciting_muffin_tin_points - except KeyError: + except Exception: muffin_tin_settings["{}_muffin_tin_points".format(label)] = None self.settings["muffin_tin_settings"] = muffin_tin_settings - except KeyError: + except Exception: pass # Other important method settings system = self._ctx.representative_system try: self.settings['rgkmax'] = "%.6f" % (system.x_exciting_rgkmax.magnitude) - except KeyError: + except Exception: pass try: self.settings['gkmax'] = "%.6f" % (1e-10 * system.x_exciting_gkmax.magnitude) - except KeyError: + except Exception: pass try: self.settings['lo'] = "%d" % (system.x_exciting_lo) - except KeyError: + except Exception: pass try: self.settings['lmaxapw'] = "%d" % (system.x_exciting_lmaxapw) - except KeyError: + except Exception: pass return self.settings -- GitLab