Skip to content

Commit

Permalink
XspectraCrystalWorkChain: Fix Input Bugs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PNOGillespie committed Nov 11, 2024
1 parent 57e7463 commit b779abc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aiida_quantumespresso/workflows/xspectra/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b779abc

Please sign in to comment.