Skip to content

Commit

Permalink
bugfix forse...
Browse files Browse the repository at this point in the history
  • Loading branch information
Miki Bonacci committed Feb 13, 2024
1 parent bc902f4 commit 15299e0
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions aiida_yambo_wannier90/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,17 +626,6 @@ def setup(self) -> None: # pylint: disable=inconsistent-return-statements
"""Initialize context variables."""

self.ctx.current_structure = self.inputs.structure

self.ctx.current_kpoint_path = None
self.ctx.current_bands_kpoints = None

if "kpoint_path" in self.inputs:
self.ctx.current_kpoint_path = get_path_from_kpoints(
self.inputs.kpoint_path
)

if "bands_kpoints" in self.inputs:
self.ctx.current_bands_kpoints = self.inputs.bands_kpoints


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

def should_run_seekpath(self):
"""Run seekpath if the `inputs.bands_kpoints` is not provided."""
if "bands_kpoints" in self.inputs:
if "kpoint_path" in self.inputs:
self.ctx.current_kpoint_path = get_path_from_kpoints(
self.inputs.bands_kpoints
)
return "bands_kpoints" not in self.inputs

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

self.ctx.current_bands_kpoints = result["explicit_kpoints"]

# Add `kpoint_path` for Wannier bands
#self.ctx.current_kpoint_path = orm.Dict(
# dict={
# "path": result["parameters"]["path"],
# "point_coords": result["parameters"]["point_coords"],
# }
#)

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

inputs.wannier90.structure = self.ctx.current_structure

params = inputs.wannier90.parameters.get_dict()
params["bands_plot"] = False

inputs.wannier90.parameters = orm.Dict(params)

#params = inputs.wannier90.parameters.get_dict()
#params["bands_plot"] = False
#inputs.wannier90.parameters = orm.Dict(params)

'''if self.ctx.current_kpoint_path:
inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path
if self.ctx.current_bands_kpoints:
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints'''
inputs.bands_kpoints = self.ctx.current_bands_kpoints

# Use commensurate kmesh
if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
Expand Down Expand Up @@ -1194,10 +1175,7 @@ def prepare_wannier90_inputs(self) -> AttributeDict:
)

inputs.structure = self.ctx.current_structure
if self.ctx.current_kpoint_path:
inputs.kpoint_path = self.ctx.current_kpoint_path
if self.ctx.current_bands_kpoints:
inputs.bands_kpoints = self.ctx.current_bands_kpoints
inputs.kpoint_path = self.ctx.current_kpoint_path

# Use commensurate kmesh
if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
Expand Down Expand Up @@ -1283,10 +1261,7 @@ def prepare_wannier90_qp_inputs(self) -> AttributeDict:
)

inputs.wannier90.structure = self.ctx.current_structure
if self.ctx.current_kpoint_path:
inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path
if self.ctx.current_bands_kpoints:
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints
inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints

if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90:
set_kpoints(
Expand Down

0 comments on commit 15299e0

Please sign in to comment.