Skip to content

Commit

Permalink
adding kkr_params_overzrite input in kkr_scf_wc
Browse files Browse the repository at this point in the history
  • Loading branch information
dantogni committed Jun 17, 2024
1 parent ff48ed1 commit 4192c3f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions aiida_kkr/workflows/kkr_scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
__copyright__ = (u'Copyright (c), 2017, Forschungszentrum Jülich GmbH, '
'IAS-1/PGI-1, Germany. All rights reserved.')
__license__ = 'MIT license, see LICENSE.txt file'
__version__ = '0.11.1'
__contributors__ = (u'Jens Broeder', u'Philipp Rüßmann')
__version__ = '0.11.2'
__contributors__ = (u'Jens Broeder', u'Philipp Rüßmann', u'David Antognini Silva')

eV2Ry = 1.0 / get_Ry2eV()

Expand Down Expand Up @@ -263,6 +263,12 @@ def define(cls, spec):
impurities. See KkrCalculation for details.
"""
)
spec.input(
'params_kkr_overwrite',
valid_type=orm.Dict,
required=False,
help='Set some input parameters of the KKR calculation.'
)

# define output nodes
spec.output(
Expand Down Expand Up @@ -1218,7 +1224,14 @@ def run_kkr(self):
description = f'KKR calculation of step {self.ctx.loop_count}, using mixing scheme {self.ctx.last_mixing_scheme}'
code = self.inputs.kkr
remote = self.ctx.last_remote
params = self.ctx.last_params
params = self.ctx.last_params.get_dict()

# overwrite some parameters of the KKR calculation by hand before setting mandatory keys
if 'params_kkr_overwrite' in self.inputs:
for key, val in self.inputs.params_kkr_overwrite.get_dict().items():
params[key] = val
self.report(f'INFO: overwriting KKR parameter: {key} with {val} from params_kkr_overwrite input node')

options = {
'max_wallclock_seconds': self.ctx.max_wallclock_seconds,
'resources': self.ctx.resources,
Expand All @@ -1233,7 +1246,7 @@ def run_kkr(self):
options,
label,
description,
parameters=params,
parameters=orm.Dict(params),
serial=(not self.ctx.withmpi),
)

Expand Down

0 comments on commit 4192c3f

Please sign in to comment.