Skip to content

Commit 15299e0

Browse files
author
Miki Bonacci
committed
bugfix forse...
1 parent bc902f4 commit 15299e0

File tree

1 file changed

+11
-36
lines changed

1 file changed

+11
-36
lines changed

aiida_yambo_wannier90/workflows/__init__.py

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -626,17 +626,6 @@ def setup(self) -> None: # pylint: disable=inconsistent-return-statements
626626
"""Initialize context variables."""
627627

628628
self.ctx.current_structure = self.inputs.structure
629-
630-
self.ctx.current_kpoint_path = None
631-
self.ctx.current_bands_kpoints = None
632-
633-
if "kpoint_path" in self.inputs:
634-
self.ctx.current_kpoint_path = get_path_from_kpoints(
635-
self.inputs.kpoint_path
636-
)
637-
638-
if "bands_kpoints" in self.inputs:
639-
self.ctx.current_bands_kpoints = self.inputs.bands_kpoints
640629

641630

642631
# Converged mesh from YamboConvergence
@@ -685,6 +674,11 @@ def setup(self) -> None: # pylint: disable=inconsistent-return-statements
685674

686675
def should_run_seekpath(self):
687676
"""Run seekpath if the `inputs.bands_kpoints` is not provided."""
677+
if "bands_kpoints" in self.inputs:
678+
if "kpoint_path" in self.inputs:
679+
self.ctx.current_kpoint_path = get_path_from_kpoints(
680+
self.inputs.bands_kpoints
681+
)
688682
return "bands_kpoints" not in self.inputs
689683

690684
def run_seekpath(self):
@@ -702,14 +696,6 @@ def run_seekpath(self):
702696
self.ctx.current_structure = result["primitive_structure"]
703697

704698
self.ctx.current_bands_kpoints = result["explicit_kpoints"]
705-
706-
# Add `kpoint_path` for Wannier bands
707-
#self.ctx.current_kpoint_path = orm.Dict(
708-
# dict={
709-
# "path": result["parameters"]["path"],
710-
# "point_coords": result["parameters"]["point_coords"],
711-
# }
712-
#)
713699

714700
structure_formula = self.inputs.structure.get_formula()
715701
primitive_structure_formula = result["primitive_structure"].get_formula()
@@ -1073,16 +1059,11 @@ def prepare_wannier90_pp_inputs(self) -> AttributeDict:
10731059

10741060
inputs.wannier90.structure = self.ctx.current_structure
10751061

1076-
params = inputs.wannier90.parameters.get_dict()
1077-
params["bands_plot"] = False
1078-
1079-
inputs.wannier90.parameters = orm.Dict(params)
1080-
1062+
#params = inputs.wannier90.parameters.get_dict()
1063+
#params["bands_plot"] = False
1064+
#inputs.wannier90.parameters = orm.Dict(params)
10811065

1082-
'''if self.ctx.current_kpoint_path:
1083-
inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path
1084-
if self.ctx.current_bands_kpoints:
1085-
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints'''
1066+
inputs.bands_kpoints = self.ctx.current_bands_kpoints
10861067

10871068
# Use commensurate kmesh
10881069
if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
@@ -1194,10 +1175,7 @@ def prepare_wannier90_inputs(self) -> AttributeDict:
11941175
)
11951176

11961177
inputs.structure = self.ctx.current_structure
1197-
if self.ctx.current_kpoint_path:
1198-
inputs.kpoint_path = self.ctx.current_kpoint_path
1199-
if self.ctx.current_bands_kpoints:
1200-
inputs.bands_kpoints = self.ctx.current_bands_kpoints
1178+
inputs.kpoint_path = self.ctx.current_kpoint_path
12011179

12021180
# Use commensurate kmesh
12031181
if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
@@ -1283,10 +1261,7 @@ def prepare_wannier90_qp_inputs(self) -> AttributeDict:
12831261
)
12841262

12851263
inputs.wannier90.structure = self.ctx.current_structure
1286-
if self.ctx.current_kpoint_path:
1287-
inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path
1288-
if self.ctx.current_bands_kpoints:
1289-
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints
1264+
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints
12901265

12911266
if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
12921267
set_kpoints(

0 commit comments

Comments
 (0)