From ed8bc532698a90a2e19fc08fd8442afc4e9cf726 Mon Sep 17 00:00:00 2001 From: AndresOrtegaGuerrero Date: Mon, 6 Nov 2023 10:20:29 +0000 Subject: [PATCH 1/3] fix logic of band_kpoints_distance for periodicity x and xy --- src/aiidalab_qe/app/result/summary_viewer.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/aiidalab_qe/app/result/summary_viewer.py b/src/aiidalab_qe/app/result/summary_viewer.py index 1162350b7..4839c9b23 100644 --- a/src/aiidalab_qe/app/result/summary_viewer.py +++ b/src/aiidalab_qe/app/result/summary_viewer.py @@ -23,6 +23,13 @@ (True, False, False): "x", } +# Bands_kpoints_distance from protocol for x and xy from protocol bands (aiida-quantumespresso) +BANDS_KPOINTS_DISTANCE = { + "fast": 0.1, + "moderate": 0.025, + "precise": 0.015, +} + def generate_report_parameters(qeapp_wc): """Generate the report parameters from the ui parameters and workchain's input. @@ -111,9 +118,15 @@ def generate_report_parameters(qeapp_wc): ) # hard code bands and pdos if "bands" in qeapp_wc.inputs: - report[ - "bands_kpoints_distance" - ] = qeapp_wc.inputs.bands.bands_kpoints_distance.value + if "bands_kpoints_distance" in qeapp_wc.inputs.bands: + report[ + "bands_kpoints_distance" + ] = qeapp_wc.inputs.bands.bands_kpoints_distance.value + else: + report["bands_kpoints_distance"] = BANDS_KPOINTS_DISTANCE[ + report["protocol"] + ] + if "pdos" in qeapp_wc.inputs: report[ "nscf_kpoints_distance" From a398c3036af1fdce79c94dcc82bccdad9f321d42 Mon Sep 17 00:00:00 2001 From: AndresOrtegaGuerrero Date: Thu, 9 Nov 2023 09:40:12 +0000 Subject: [PATCH 2/3] using get_protocol_inputs from qe plugin --- src/aiidalab_qe/app/result/summary_viewer.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/aiidalab_qe/app/result/summary_viewer.py b/src/aiidalab_qe/app/result/summary_viewer.py index 4839c9b23..441bc7275 100644 --- a/src/aiidalab_qe/app/result/summary_viewer.py +++ b/src/aiidalab_qe/app/result/summary_viewer.py @@ -1,4 +1,5 @@ import ipywidgets as ipw +from aiida_quantumespresso.workflows.pw.bands import PwBandsWorkChain FUNCTIONAL_LINK_MAP = { "PBE": "https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.77.3865", @@ -23,14 +24,6 @@ (True, False, False): "x", } -# Bands_kpoints_distance from protocol for x and xy from protocol bands (aiida-quantumespresso) -BANDS_KPOINTS_DISTANCE = { - "fast": 0.1, - "moderate": 0.025, - "precise": 0.015, -} - - def generate_report_parameters(qeapp_wc): """Generate the report parameters from the ui parameters and workchain's input. @@ -118,14 +111,7 @@ def generate_report_parameters(qeapp_wc): ) # hard code bands and pdos if "bands" in qeapp_wc.inputs: - if "bands_kpoints_distance" in qeapp_wc.inputs.bands: - report[ - "bands_kpoints_distance" - ] = qeapp_wc.inputs.bands.bands_kpoints_distance.value - else: - report["bands_kpoints_distance"] = BANDS_KPOINTS_DISTANCE[ - report["protocol"] - ] + report["bands_kpoints_distance"] = PwBandsWorkChain.get_protocol_inputs(report["protocol"])["bands_kpoints_distance"] if "pdos" in qeapp_wc.inputs: report[ From 902dd333d825d0b9b9dd4255755600d9281d7e97 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:40:55 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/aiidalab_qe/app/result/summary_viewer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aiidalab_qe/app/result/summary_viewer.py b/src/aiidalab_qe/app/result/summary_viewer.py index 441bc7275..45880cbc8 100644 --- a/src/aiidalab_qe/app/result/summary_viewer.py +++ b/src/aiidalab_qe/app/result/summary_viewer.py @@ -24,6 +24,7 @@ (True, False, False): "x", } + def generate_report_parameters(qeapp_wc): """Generate the report parameters from the ui parameters and workchain's input. @@ -111,7 +112,9 @@ def generate_report_parameters(qeapp_wc): ) # hard code bands and pdos if "bands" in qeapp_wc.inputs: - report["bands_kpoints_distance"] = PwBandsWorkChain.get_protocol_inputs(report["protocol"])["bands_kpoints_distance"] + report["bands_kpoints_distance"] = PwBandsWorkChain.get_protocol_inputs( + report["protocol"] + )["bands_kpoints_distance"] if "pdos" in qeapp_wc.inputs: report[