-
Notifications
You must be signed in to change notification settings - Fork 17
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
Set relax type none and no properites to run SCF only #274
Changes from 4 commits
b9b55ed
518abc5
ac0b3cd
792317e
8b2daf3
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from aiida.common.exceptions import NotExistentAttributeError | ||
from aiida.plugins import WorkflowFactory | ||
|
||
PwBaseWorkChain = WorkflowFactory("quantumespresso.pw.base") | ||
|
@@ -98,27 +99,27 @@ def _generate_report_dict(qeapp_wc): | |
# read default from protocol | ||
smearing = default_params["smearing"] | ||
|
||
if run_relax: | ||
try: | ||
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 think this |
||
pw_parameters = qeapp_wc.inputs.relax.base.pw.parameters.get_dict() | ||
if scf_kpoints_distance is None: | ||
scf_kpoints_distance = qeapp_wc.inputs.relax.base.kpoints_distance.value | ||
if run_bands: | ||
pw_parameters = qeapp_wc.inputs.bands.scf.pw.parameters.get_dict() | ||
if scf_kpoints_distance is None: | ||
scf_kpoints_distance = qeapp_wc.inputs.bands.scf.kpoints_distance.value | ||
bands_kpoints_distance = qeapp_wc.inputs.bands.bands_kpoints_distance.value | ||
if run_pdos: | ||
scf_kpoints_distance = ( | ||
scf_kpoints_distance or qeapp_wc.inputs.pdos.scf.kpoints_distance.value | ||
) | ||
pw_parameters = ( | ||
pw_parameters or qeapp_wc.inputs.pdos.scf.pw.parameters.get_dict() | ||
) | ||
nscf_kpoints_distance = qeapp_wc.inputs.pdos.nscf.kpoints_distance.value | ||
|
||
if pw_parameters: | ||
energy_cutoff_wfc = round(pw_parameters["SYSTEM"]["ecutwfc"]) | ||
energy_cutoff_rho = round(pw_parameters["SYSTEM"]["ecutrho"]) | ||
except NotExistentAttributeError: | ||
if run_bands: | ||
pw_parameters = qeapp_wc.inputs.bands.scf.pw.parameters.get_dict() | ||
if scf_kpoints_distance is None: | ||
scf_kpoints_distance = qeapp_wc.inputs.bands.scf.kpoints_distance.value | ||
bands_kpoints_distance = qeapp_wc.inputs.bands.bands_kpoints_distance.value | ||
if run_pdos: | ||
scf_kpoints_distance = ( | ||
scf_kpoints_distance or qeapp_wc.inputs.pdos.scf.kpoints_distance.value | ||
) | ||
pw_parameters = ( | ||
pw_parameters or qeapp_wc.inputs.pdos.scf.pw.parameters.get_dict() | ||
) | ||
nscf_kpoints_distance = qeapp_wc.inputs.pdos.nscf.kpoints_distance.value | ||
|
||
energy_cutoff_wfc = round(pw_parameters["SYSTEM"]["ecutwfc"]) | ||
energy_cutoff_rho = round(pw_parameters["SYSTEM"]["ecutrho"]) | ||
|
||
yield "energy_cutoff_wfc", energy_cutoff_wfc | ||
yield "energy_cutoff_rho", energy_cutoff_rho | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,21 +425,8 @@ def set_input_parameters(self, parameters): | |
def _update_state(self, _=None): | ||
if self.previous_step_state == self.State.SUCCESS: | ||
self.confirm_button.disabled = False | ||
if not ( | ||
self.workchain_settings.relax_type.value != "none" | ||
or self.workchain_settings.bands_run.value | ||
or self.workchain_settings.pdos_run.value | ||
): | ||
self.confirm_button.disabled = True | ||
self.state = self.State.READY | ||
self._submission_blocker_messages.value = """ | ||
<div class="alert alert-info"> | ||
The configured work chain would not actually compute anything. | ||
Select either a structure relaxation method or at least one of the | ||
the bands or the PDOS calculations or both.</div>""" | ||
else: | ||
self._submission_blocker_messages.value = "" | ||
self.state = self.State.CONFIGURED | ||
self._submission_blocker_messages.value = "" | ||
self.state = self.State.CONFIGURED | ||
elif self.previous_step_state == self.State.FAIL: | ||
self.state = self.State.FAIL | ||
else: | ||
|
@@ -878,6 +865,12 @@ def update_builder(buildy, resources, npools): | |
if "smearing_override" in parameters: | ||
builder.smearing_override = Str(parameters["smearing_override"]) | ||
|
||
# skip relax sub-worflow only when RelaxType is NONE and has property calculated. | ||
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. Could you explain the difference between relax (only scf) and relax sub-workflow? I am not very clear about this, thanks. 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. You can find how this tag change the parameters set in
unkcpz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if RelaxType(parameters["relax_type"]) is RelaxType.NONE and ( | ||
parameters["run_bands"] or parameters["run_pdos"] | ||
): | ||
builder.pop("relax") | ||
|
||
if not parameters.get("run_bands", False): | ||
builder.pop("bands") | ||
|
||
|
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.
Why is "none", not
None
or "None". Please make sure "none" is correct.If it is correct, we need to change it to a more standard way, e.g.
None
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.
relax_type
is a parameter read from widget.The string type is used to distinguish the
None
in purpose.