-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protocols: Move all static work chain inputs to protocol #902
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ default_inputs: | |
base_final_scf: | ||
pw: | ||
parameters: | ||
CELL: | ||
press_conv_thr: 0.5 | ||
CONTROL: | ||
calculation: scf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not ask questions how a pressure convergence condition was the only part of the "scf" step of the |
||
default_protocol: moderate | ||
protocols: | ||
moderate: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,15 @@ | |
from aiida import orm | ||
from aiida.common import AttributeDict | ||
from aiida.engine import ToContext, WorkChain, if_ | ||
from aiida.plugins import WorkflowFactory | ||
|
||
from aiida_quantumespresso.calculations.functions.seekpath_structure_analysis import seekpath_structure_analysis | ||
from aiida_quantumespresso.calculations.pw import PwCalculation | ||
from aiida_quantumespresso.utils.mapping import prepare_process_inputs | ||
from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain | ||
from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain | ||
|
||
from ..protocols.utils import ProtocolMixin | ||
|
||
PwBaseWorkChain = WorkflowFactory('quantumespresso.pw.base') | ||
PwRelaxWorkChain = WorkflowFactory('quantumespresso.pw.relax') | ||
|
||
|
||
def validate_inputs(inputs, ctx=None): # pylint: disable=unused-argument | ||
"""Validate the inputs of the entire input namespace.""" | ||
|
@@ -72,6 +71,7 @@ def define(cls, spec): | |
help='Explicit kpoints to use for the BANDS calculation. Specify either this or `bands_kpoints_distance`.') | ||
spec.input('bands_kpoints_distance', valid_type=orm.Float, required=False, | ||
help='Minimum kpoints distance for the BANDS calculation. Specify either this or `bands_kpoints`.') | ||
spec.inputs['bands']['pw'].validator = PwCalculation.validate_inputs_base | ||
spec.inputs.validator = validate_inputs | ||
spec.outline( | ||
cls.setup, | ||
|
@@ -228,13 +228,12 @@ def run_scf(self): | |
inputs = AttributeDict(self.exposed_inputs(PwBaseWorkChain, namespace='scf')) | ||
inputs.metadata.call_link_label = 'scf' | ||
inputs.pw.structure = self.ctx.current_structure | ||
inputs.pw.parameters = inputs.pw.parameters.get_dict() | ||
inputs.pw.parameters.setdefault('CONTROL', {})['calculation'] = 'scf' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are removing this, maybe we move line 231 to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Want to still add this change @mbercx ? Then this can be merged There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I missed this comment somehow. On it! 🚀 |
||
|
||
# Make sure to carry the number of bands from the relax workchain if it was run and it wasn't explicitly defined | ||
# in the inputs. One of the base workchains in the relax workchain may have changed the number automatically in | ||
# the sanity checks on band occupations. | ||
if self.ctx.current_number_of_bands: | ||
inputs.pw.parameters = inputs.pw.parameters.get_dict() | ||
inputs.pw.parameters.setdefault('SYSTEM', {}).setdefault('nbnd', self.ctx.current_number_of_bands) | ||
|
||
inputs = prepare_process_inputs(PwBaseWorkChain, inputs) | ||
|
@@ -267,13 +266,6 @@ def run_bands(self): | |
inputs.pw.parameters.setdefault('SYSTEM', {}) | ||
inputs.pw.parameters.setdefault('ELECTRONS', {}) | ||
|
||
# The following flags always have to be set in the parameters, regardless of what caller specified in the inputs | ||
inputs.pw.parameters['CONTROL']['calculation'] = 'bands' | ||
|
||
# Only set the following parameters if not directly explicitly defined in the inputs | ||
inputs.pw.parameters['ELECTRONS'].setdefault('diagonalization', 'cg') | ||
inputs.pw.parameters['ELECTRONS'].setdefault('diago_full_acc', True) | ||
|
||
# If `nbands_factor` is defined in the inputs we set the `nbnd` parameter | ||
if 'nbands_factor' in self.inputs: | ||
factor = self.inputs.nbands_factor.value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value was added in QE 6.6? Since that is the oldest version we support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yessir, see
#830 (comment)