Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 22, 2022
1 parent b1e0a3c commit d837cf8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
14 changes: 8 additions & 6 deletions aiidalab_qe/node_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import traitlets
from aiida.cmdline.utils.common import get_workchain_report
from aiida.common import LinkType
from aiida.orm import CalcJobNode, Node, WorkChainNode, ProjectionData
from aiida.orm import CalcJobNode, Node, ProjectionData, WorkChainNode
from aiidalab_widgets_base import ProcessMonitor, register_viewer_widget
from aiidalab_widgets_base.viewers import StructureDataViewer
from ase import Atoms
Expand Down Expand Up @@ -130,15 +130,17 @@ def export_pdos_data(work_chain_node):
pdos_orbitals = []

if "projections" in work_chain_node.outputs:
projection_list = [(work_chain_node.outputs.projections, None),]
projection_list = [
(work_chain_node.outputs.projections, None),
]
else:
projection_list = [
(work_chain_node.outputs.projections_up, "up"),
(work_chain_node.outputs.projections_down, "dn")
(work_chain_node.outputs.projections_down, "dn"),
]
tdos_values['dos | states/eV'] = (
tdos_values.pop('dos_spin_up | states/eV') + tdos_values.pop('dos_spin_down | states/eV')
)
tdos_values["dos | states/eV"] = tdos_values.pop(
"dos_spin_up | states/eV"
) + tdos_values.pop("dos_spin_down | states/eV")

for projections, suffix in projection_list:
for orbital, pdos, energy in projections.get_pdos():
Expand Down
14 changes: 11 additions & 3 deletions src/aiidalab_qe_workchain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,18 @@ def results(self):
)
self.out("dos", self.ctx.workchain_pdos.outputs.dos__output_dos)
if "projections_up" in self.ctx.workchain_pdos.outputs.projwfc:
self.out("projections_up", self.ctx.workchain_pdos.outputs.projwfc.projections_up)
self.out("projections_down", self.ctx.workchain_pdos.outputs.projwfc.projections_down)
self.out(
"projections_up",
self.ctx.workchain_pdos.outputs.projwfc.projections_up,
)
self.out(
"projections_down",
self.ctx.workchain_pdos.outputs.projwfc.projections_down,
)
else:
self.out("projections", self.ctx.workchain_pdos.outputs.projwfc.projections)
self.out(
"projections", self.ctx.workchain_pdos.outputs.projwfc.projections
)

def on_terminated(self):
"""Clean the working directories of all child calculations if `clean_workdir=True` in the inputs."""
Expand Down

0 comments on commit d837cf8

Please sign in to comment.