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

Function visualize

dask/base.py:686–786  ·  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

684
685
686def visualize(
687 *args,
688 filename="mydask",
689 traverse=True,
690 optimize_graph=False,
691 maxval=None,
692 engine: Literal["cytoscape", "ipycytoscape", "graphviz"] | None = None,
693 **kwargs,
694):
695 """
696 Visualize several dask graphs simultaneously.
697
698 Requires ``graphviz`` to be installed. All options that are not the dask
699 graph(s) should be passed as keyword arguments.
700
701 Parameters
702 ----------
703 args : object
704 Any number of objects. If it is a dask collection (for example, a
705 dask DataFrame, Array, Bag, or Delayed), its associated graph
706 will be included in the output of visualize. By default, python builtin
707 collections are also traversed to look for dask objects (for more
708 information see the ``traverse`` keyword). Arguments lacking an
709 associated graph will be ignored.
710 filename : str or None, optional
711 The name of the file to write to disk. If the provided `filename`
712 doesn't include an extension, '.png' will be used by default.
713 If `filename` is None, no file will be written, and we communicate
714 with dot using only pipes.
715 format : {'png', 'pdf', 'dot', 'svg', 'jpeg', 'jpg'}, optional
716 Format in which to write output file. Default is 'png'.
717 traverse : bool, optional
718 By default, dask traverses builtin python collections looking for dask
719 objects passed to ``visualize``. For large collections this can be
720 expensive. If none of the arguments contain any dask objects, set
721 ``traverse=False`` to avoid doing this traversal.
722 optimize_graph : bool, optional
723 If True, the graph is optimized before rendering. Otherwise,
724 the graph is displayed as is. Default is False.
725 color : {None, 'order', 'ages', 'freed', 'memoryincreases', 'memorydecreases', 'memorypressure'}, optional
726 Options to color nodes. colormap:
727
728 - None, the default, no colors.
729 - 'order', colors the nodes' border based on the order they appear in the graph.
730 - 'ages', how long the data of a node is held.
731 - 'freed', the number of dependencies released after running a node.
732 - 'memoryincreases', how many more outputs are held after the lifetime of a node.
733 Large values may indicate nodes that should have run later.
734 - 'memorydecreases', how many fewer outputs are held after the lifetime of a node.
735 Large values may indicate nodes that should have run sooner.
736 - 'memorypressure', the number of data held when the node is run (circle), or
737 the data is released (rectangle).
738 maxval : {int, float}, optional
739 Maximum value for colormap to normalize form 0 to 1.0. Default is ``None``
740 will make it the max number of values
741 collapse_outputs : bool, optional
742 Whether to collapse output boxes, which often have empty labels.
743 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