MCPcopy Create free account
hub / github.com/dask/dask / visualize

Method visualize

dask/_expr.py:778–799  ·  view source on GitHub ↗

Visualize the expression graph. Requires ``graphviz`` to be installed. Parameters ---------- filename : str or None, optional The name of the file to write to disk. If the provided `filename` doesn't include an extension, '.png' will

(self, filename="dask-expr.svg", format=None, **kwargs)

Source from the content-addressed store, hash-verified

776 return g
777
778 def visualize(self, filename="dask-expr.svg", format=None, **kwargs):
779 """
780 Visualize the expression graph.
781 Requires ``graphviz`` to be installed.
782
783 Parameters
784 ----------
785 filename : str or None, optional
786 The name of the file to write to disk. If the provided `filename`
787 doesn't include an extension, '.png' will be used by default.
788 If `filename` is None, no file will be written, and the graph is
789 rendered in the Jupyter notebook only.
790 format : {'png', 'pdf', 'dot', 'svg', 'jpeg', 'jpg'}, optional
791 Format in which to write output file. Default is 'svg'.
792 **kwargs
793 Additional keyword arguments to forward to ``to_graphviz``.
794 """
795 from dask.dot import graphviz_to_file
796
797 g = self._to_graphviz(**kwargs)
798 graphviz_to_file(g, filename, format)
799 return g
800
801 def walk(self) -> Generator[Expr]:
802 """Iterate through all expressions in the tree

Callers

nothing calls this directly

Calls 2

_to_graphvizMethod · 0.95
graphviz_to_fileFunction · 0.90

Tested by

no test coverage detected