Skip to content

Commit

Permalink
report.py -re: xing
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 14, 2022
1 parent 792317e commit 8b2daf3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion aiidalab_qe/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def find_work_chains(cls):
relax_type = builder_parameters.get("relax_type")

if relax_type != "none":
relax_info = "structure is not relaxed"
relax_info = "structure is relaxed"
else:
relax_info = "static SCF calculation on structure"
else:
Expand Down
34 changes: 16 additions & 18 deletions aiidalab_qe/report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from aiida.common.exceptions import NotExistentAttributeError
from aiida.plugins import WorkflowFactory

PwBaseWorkChain = WorkflowFactory("quantumespresso.pw.base")
Expand Down Expand Up @@ -99,24 +98,23 @@ def _generate_report_dict(qeapp_wc):
# read default from protocol
smearing = default_params["smearing"]

try:
pw_parameters = qeapp_wc.inputs.relax.base.pw.parameters.get_dict()
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.relax.base.kpoints_distance.value
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
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"])
Expand Down
2 changes: 1 addition & 1 deletion aiidalab_qe/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ 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.
# skip relax sub-workflow only when RelaxType is NONE and has property calculated.
if RelaxType(parameters["relax_type"]) is RelaxType.NONE and (
parameters["run_bands"] or parameters["run_pdos"]
):
Expand Down

0 comments on commit 8b2daf3

Please sign in to comment.