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