Skip to content

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
- take care of edge case where Zimp is not a list but a number (happens for single impurity case without specification of imp_cls input)
- fix renaming params_kkr_overwrite -> params_overwrite
  • Loading branch information
PhilippRue committed Oct 7, 2024
1 parent 02b1aaf commit 8610289
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion aiida_kkr/tools/tools_STM_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ def get_imp_info_add_position(add_position, host_structure, imp_info):
#raise ValueError('Additional position exists already in impurity cluster.')
cluster_combined, rimp_rel_combined, _, _ = combine_clusters(clust1, clust2_offset, False, debug=False)
# combine the zimp arrays
zimp_combined = imp_info['Zimp'] + imp_info2['Zimp']
zimp1 = imp_info['Zimp']
if not isinstance(zimp1, list):
# convert to list if necessary
zimp1 = [zimp1]
zimp_combined = zimp1 + imp_info2['Zimp']
# now combine the imp info node
imp_info_combined = orm.Dict({'imp_cls': cluster_combined, 'Zimp': zimp_combined, 'Rimp_rel': rimp_rel_combined})

Expand Down
10 changes: 5 additions & 5 deletions aiida_kkr/workflows/kkr_STM.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class kkr_STM_wc(WorkChain):
:param kkr: (Code), KKR host code for the writing out kkrflex files
:param kkrimp: (Code), KKR impurity code for the normal state impurity scf and BdG impurity DOS calculation
:param gf_writeout.params_kkr_overwrite (Dict), overwrite parameters for the GF calculation
:param kkr_imp_sub.params_kkr_overwrite (Dict), overwrite parameters for the impurity calculation
:param kkr_imp_sub.params_overwrite (Dict), overwrite parameters for the impurity calculation
returns::
Expand Down Expand Up @@ -499,8 +499,8 @@ def STM_lmdos_run(self):

# Update the BdG parameters if they are inserted in the workflow
if 'BdG' in self.inputs:
if 'params_kkr_overwrite' in self.inputs.BdG:
builder.BdG.params_overwrite = self.inputs.BdG.params_kkr_overwrite # pylint: disable=no-member
if 'params_overwrite' in self.inputs.BdG:
builder.BdG.params_overwrite = self.inputs.BdG.params_overwrite # pylint: disable=no-member

self.ctx.kkrimp_params_dict = Dict(
dict={
Expand Down Expand Up @@ -559,8 +559,8 @@ def STM_lmdos_run(self):

# print report
message = f"""INFO: running DOS step for an STM measurement (pk: {calc.pk}) at position (ilayer: {self.inputs.tip_position['ilayer']})"""
if 'params_kkr_overwrite' in self.inputs.BdG:
if self.inputs.BdG.params_kkr_overwrite:
if 'params_overwrite' in self.inputs.BdG:
if self.inputs.BdG.params_overwrite:
message += f'\nINFO: runnig DOS step (pk: {calc.pk}) BdG is present'
self.report(message)

Expand Down

0 comments on commit 8610289

Please sign in to comment.