From b779abcb5380b12ac07fcbefd8b30e7af7e7b3f8 Mon Sep 17 00:00:00 2001 From: "Peter N. O. Gillespie" Date: Mon, 11 Nov 2024 10:44:48 +0000 Subject: [PATCH] `XspectraCrystalWorkChain`: Fix Input Bugs Fixes two bugs in the input steps of the `XspectraCrystalWorkChain`: * `WorkChain`s except when using `xch_smear` because the step to remove instances of `starting_magnetization(` was `pop`ing keys from the dictionary which it was looping over. * The `abs_atom_marker` input was not being passed to `get_xspectra_structures` correctly due to a typo. --- src/aiida_quantumespresso/workflows/xspectra/crystal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aiida_quantumespresso/workflows/xspectra/crystal.py b/src/aiida_quantumespresso/workflows/xspectra/crystal.py index 76c866fca..0619b0895 100644 --- a/src/aiida_quantumespresso/workflows/xspectra/crystal.py +++ b/src/aiida_quantumespresso/workflows/xspectra/crystal.py @@ -523,7 +523,7 @@ def get_xspectra_structures(self): inputs = { 'absorbing_elements_list' : elements_list, - 'absorbing_atom_marker' : self.inputs.abs_atom_marker, + 'abs_atom_marker' : self.inputs.abs_atom_marker, 'metadata' : { 'call_link_label' : 'get_xspectra_structures' } @@ -686,7 +686,9 @@ def run_all_xspectra_core(self): # pylint: disable=too-many-statements new_scf_params['SYSTEM']['starting_magnetization'] = {abs_atom_marker : 1} # remove any duplicates created from the "core_hole_treatments.yaml" defaults - for key in new_scf_params['SYSTEM'].keys(): + # new_scf_params_keys = [k for k in new_scf_params['SYSTEM'].keys()] + new_scf_params_keys = list(new_scf_params['SYSTEM'].keys()) + for key in new_scf_params_keys: if 'starting_magnetization(' in key: new_scf_params['SYSTEM'].pop(key, None)