Skip to content

Commit

Permalink
clean pdos setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresOrtegaGuerrero committed Nov 22, 2023
1 parent a1a1a00 commit 4205de3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/aiidalab_qe/plugins/pdos/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
from aiida_quantumespresso.calculations.functions.create_kpoints_from_distance import (
create_kpoints_from_distance,
)
from aiida_quantumespresso.workflows.pdos import PdosWorkChain

from aiidalab_qe.common.panel import Panel

# nscf_kpoints_distance values from PdosWorkChain
NSCF_DISTANCE_MAP = {
"fast": 0.5,
"moderate": 0.1,
"precise": 0.05,
}


class Setting(Panel):
title = "PDOS"
Expand Down Expand Up @@ -48,7 +42,9 @@ def __init__(self, **kwargs):

@tl.observe("protocol")
def _procotol_changed(self, change):
self.nscf_kpoints_distance.value = NSCF_DISTANCE_MAP[change["new"]]
self.nscf_kpoints_distance.value = PdosWorkChain.get_protocol_inputs(
change["new"]
)["nscf"]["kpoints_distance"]
self._display_mesh()

@tl.observe("input_structure")
Expand All @@ -58,7 +54,7 @@ def _update_structure(self, _=None):
def _display_mesh(self, _=None):
if self.input_structure is None:
return
mesh = create_kpoints_from_distance(
mesh = create_kpoints_from_distance.process_class._func(
self.input_structure,
orm.Float(self.nscf_kpoints_distance.value),
orm.Bool(True),
Expand Down

0 comments on commit 4205de3

Please sign in to comment.