Skip to content

Commit

Permalink
Reduce number of __getitem__ calls (#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen authored Aug 13, 2024
1 parent a9a6362 commit c8e17b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/quacc/recipes/espresso/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@ def bands_flow(
force_gamma=force_gamma,
)
results = {"bands_pw": bands_results}
bands_results_dir = bands_results["dir_name"]

if run_bands_pp:
bands_pp_results = bands_pp_job_(prev_outdir=bands_results["dir_name"])
bands_pp_results = bands_pp_job_(prev_outdir=bands_results_dir)
results["bands_pp"] = bands_pp_results

if run_fermi_surface:
fermi_results = fermi_surface_job_(prev_outdir=bands_results["dir_name"])
fermi_results = fermi_surface_job_(prev_outdir=bands_results_dir)
results["fermi_surface"] = fermi_results

return results
10 changes: 6 additions & 4 deletions src/quacc/recipes/espresso/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ def dos_flow(
)

static_results = static_job_(atoms)
non_scf_results = non_scf_job_(atoms, prev_outdir=static_results["dir_name"])
dos_results = dos_job_(prev_outdir=static_results["dir_name"])
static_results_dir = static_results["dir_name"]
non_scf_results = non_scf_job_(atoms, prev_outdir=static_results_dir)
dos_results = dos_job_(prev_outdir=static_results_dir)

return {
"static_job": static_results,
Expand Down Expand Up @@ -282,8 +283,9 @@ def projwfc_flow(
)

static_results = static_job_(atoms)
non_scf_results = non_scf_job_(atoms, prev_outdir=static_results["dir_name"])
projwfc_results = projwfc_job_(prev_outdir=static_results["dir_name"])
static_results_dir = static_results["dir_name"]
non_scf_results = non_scf_job_(atoms, prev_outdir=static_results_dir)
projwfc_results = projwfc_job_(prev_outdir=static_results_dir)

return {
"static_job": static_results,
Expand Down

0 comments on commit c8e17b5

Please sign in to comment.