Skip to content

Commit

Permalink
Merge branch 'main' into guide_centres
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojunfeng authored Jun 21, 2024
2 parents 8f03829 + d6794cf commit 5b93c02
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/aiida_wannier90_workflows/workflows/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ def run_wannier90_optimize(self):
}

# Disable the error handler which might modify dis_proj_min
handler_overrides = {"handle_disentanglement_not_enough_states": False}
handler_overrides = {
"handle_disentanglement_not_enough_states": {"enabled": False}
}
inputs["handler_overrides"] = orm.Dict(handler_overrides)

inputs = prepare_process_inputs(Wannier90BaseWorkChain, inputs)
Expand Down Expand Up @@ -734,16 +736,18 @@ def results(self):
namespace="wannier90_plot",
)
)
if "interpolated_bands" in self.outputs["wannier90_plot"]:
w90_bands = self.outputs["wannier90_plot"]["interpolated_bands"]
self.out("band_structure", w90_bands)

if "optimize_reference_bands" in self.inputs:
if self.has_run_wannier90_optimize():
optimal_workchain = self.ctx.optimize_best
else:
# Even if I haven't run optimization, I still output bands distance if reference bands is present
optimal_workchain = self.ctx.workchain_wannier90

if "interpolated_bands" in optimal_workchain.outputs:
# Override the `band_strucure` from W90BandsWorkChain
w90_optimal_bands = optimal_workchain.outputs["interpolated_bands"]
self.out("band_structure", w90_optimal_bands)
bandsdist = self._get_bands_distance(optimal_workchain)
bandsdist = orm.Float(bandsdist)
bandsdist.store()
Expand Down

0 comments on commit 5b93c02

Please sign in to comment.