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

Function visualize

dask/base.py:774–874  ·  view source on GitHub ↗

Visualize several dask graphs simultaneously. Requires ``graphviz`` to be installed. All options that are not the dask graph(s) should be passed as keyword arguments. Parameters ---------- args : object Any number of objects. If it is a dask collection (for example

(
    *args,
    filename="mydask",
    traverse=True,
    optimize_graph=False,
    maxval=None,
    engine: Literal["cytoscape", "ipycytoscape", "graphviz"] | None = None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

772
773
774def visualize(
775 *args,
776 filename="mydask",
777 traverse=True,
778 optimize_graph=False,
779 maxval=None,
780 engine: Literal["cytoscape", "ipycytoscape", "graphviz"] | None = None,
781 **kwargs,
782):
783 """
784 Visualize several dask graphs simultaneously.
785
786 Requires ``graphviz`` to be installed. All options that are not the dask
787 graph(s) should be passed as keyword arguments.
788
789 Parameters
790 ----------
791 args : object
792 Any number of objects. If it is a dask collection (for example, a
793 dask DataFrame, Array, Bag, or Delayed), its associated graph
794 will be included in the output of visualize. By default, python builtin
795 collections are also traversed to look for dask objects (for more
796 information see the ``traverse`` keyword). Arguments lacking an
797 associated graph will be ignored.
798 filename : str or None, optional
799 The name of the file to write to disk. If the provided `filename`
800 doesn't include an extension, '.png' will be used by default.
801 If `filename` is None, no file will be written, and we communicate
802 with dot using only pipes.
803 format : {'png', 'pdf', 'dot', 'svg', 'jpeg', 'jpg'}, optional
804 Format in which to write output file. Default is 'png'.
805 traverse : bool, optional
806 By default, dask traverses builtin python collections looking for dask
807 objects passed to ``visualize``. For large collections this can be
808 expensive. If none of the arguments contain any dask objects, set
809 ``traverse=False`` to avoid doing this traversal.
810 optimize_graph : bool, optional
811 If True, the graph is optimized before rendering. Otherwise,
812 the graph is displayed as is. Default is False.
813 color : {None, 'order', 'ages', 'freed', 'memoryincreases', 'memorydecreases', 'memorypressure'}, optional
814 Options to color nodes. colormap:
815
816 - None, the default, no colors.
817 - 'order', colors the nodes' border based on the order they appear in the graph.
818 - 'ages', how long the data of a node is held.
819 - 'freed', the number of dependencies released after running a node.
820 - 'memoryincreases', how many more outputs are held after the lifetime of a node.
821 Large values may indicate nodes that should have run later.
822 - 'memorydecreases', how many fewer outputs are held after the lifetime of a node.
823 Large values may indicate nodes that should have run sooner.
824 - 'memorypressure', the number of data held when the node is run (circle), or
825 the data is released (rectangle).
826 maxval : {int, float}, optional
827 Maximum value for colormap to normalize form 0 to 1.0. Default is ``None``
828 will make it the max number of values
829 collapse_outputs : bool, optional
830 Whether to collapse output boxes, which often have empty labels.
831 Default is False.

Callers 2

test_visualizeFunction · 0.90
visualizeMethod · 0.70

Calls 4

collections_to_exprFunction · 0.85
visualize_dskFunction · 0.85
unpack_collectionsFunction · 0.70
__dask_graph__Method · 0.45

Tested by 1

test_visualizeFunction · 0.72