Skip to content

Commit

Permalink
Minor improvements to DAG visualization (#348)
Browse files Browse the repository at this point in the history
* Show if DAG was optimized on visualization

* Left justify lines in graph caption in DAG
  • Loading branch information
tomwhite authored Jan 16, 2024
1 parent f3c3b94 commit 6364895
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cubed/core/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,11 @@ def visualize(
dag.graph["graph"] = {
"rankdir": rankdir,
"label": (
f"num tasks: {self.num_tasks(optimize_graph, optimize_function)}\n"
f"max projected memory: {memory_repr(self.max_projected_mem(optimize_graph, optimize_function))}\n"
f"total nbytes: {memory_repr(self.total_nbytes(optimize_graph, optimize_function))}"
# note that \l is used to left-justify each line (see https://www.graphviz.org/docs/attrs/nojustify/)
rf"num tasks: {self.num_tasks(optimize_graph, optimize_function)}\l"
rf"max projected memory: {memory_repr(self.max_projected_mem(optimize_graph, optimize_function))}\l"
rf"total nbytes: {memory_repr(self.total_nbytes(optimize_graph, optimize_function))}\l"
rf"optimized: {optimize_graph}\l"
),
"labelloc": "bottom",
"labeljust": "left",
Expand Down

0 comments on commit 6364895

Please sign in to comment.