Skip to content

Commit

Permalink
Avoid computing redundant computations to first order in the recursiv…
Browse files Browse the repository at this point in the history
…e dependency structure
  • Loading branch information
unalmis committed May 2, 2024
1 parent e1c6f44 commit 05fb63b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion desc/equilibrium/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,13 @@ def compute(
# we first figure out what needed qtys are flux functions or volume integrals
# and compute those first on a full grid
p = "desc.equilibrium.equilibrium.Equilibrium"
deps = list(set(get_data_deps(names, obj=p, has_axis=grid.axis.size) + names))
# If the user wants to compute x which depends on y which in turn depends on z,
# and they pass in y already computed in data, then we shouldn't need to compute
# z at all.
deps = list(
set(get_data_deps(names, obj=p, has_axis=grid.axis.size) + names)
- data.keys() # subtract out y if already computed
)
# TODO: replace this logic with `grid_type` from data_index
dep0d = [
dep
Expand Down

0 comments on commit 05fb63b

Please sign in to comment.