From 8cf4685aca1a7f1abe5c7245fac42939075a3501 Mon Sep 17 00:00:00 2001 From: ndaelman-hu <107392603+ndaelman-hu@users.noreply.github.com> Date: Tue, 17 Sep 2024 08:38:59 +0200 Subject: [PATCH] 115 issues with dft xc extraction (#119) * Handle cases where Jacob's Ladder's is or * Move patch into definition `highest_rung_abbrev` --------- Co-authored-by: ndaelman --- src/nomad_simulations/schema_packages/model_method.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nomad_simulations/schema_packages/model_method.py b/src/nomad_simulations/schema_packages/model_method.py index 36822191..2ef35b89 100644 --- a/src/nomad_simulations/schema_packages/model_method.py +++ b/src/nomad_simulations/schema_packages/model_method.py @@ -202,7 +202,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: self.libxc_name = libxc_name_weight + self.libxc_name # ! check with @ndaelman-hu if this makes sense (COMMENTED OUT FOR NOW) - # Appending `"+alpha"` in `libxc_name` for hybrids in which the `exact_exchange_mixing_factoris` included + # Appending `"+alpha"` in `libxc_name` for hybrids in which the `exact_exchange_mixing_factor` is included # libxc_name_alpha = '' # if ( # self.name == 'hybrid' @@ -349,7 +349,9 @@ def resolve_jacobs_ladder( continue try: - highest_rung_abbrev = max(abbrevs, key=lambda x: rung_order[x]) + highest_rung_abbrev = ( + max(abbrevs, key=lambda x: rung_order[x]) if abbrevs else None + ) except KeyError: return 'unavailable' return self._jacobs_ladder_map.get(highest_rung_abbrev, 'unavailable')