Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Dask .visualize() does not show the full graph

My Dask .visualize() does not show the graph properly. The code was taken from http://github.com/dask/dask-tutorial/ 01_dask.delayed.ipynb notebook.

I installed graphviz using pip and apt. Even though the graph is displayed, it is not fully shown. I am running the code on jupyter Lab

def inc(x):
    return x + 1

def double(x):
    return x + 2

def add(x, y):
    return x + y

data = [1, 2, 3, 4, 5]

output = []
for x in data:
    a = inc(x)
    b = double(x)
    c = add(a, b)
    output.append(c)

total = sum(output)

import dask

output = []
for x in data:
    a = dask.delayed(inc)(x)
    b = dask.delayed(double)(x)
    c = dask.delayed(add)(a, b)
    output.append(c)

total = dask.delayed(sum)(output)

total.visualize()  # see image to the right

I expected the boxes in the image to be also filled with data. my output of code

like image 664
Schroter Michael Avatar asked Sep 11 '26 12:09

Schroter Michael


1 Answers

This was a deliberate change in Dask, because we found that the labels of the boxes presented redundant data with names like "inc #1", which, since it comes from a function called "inc" is already obvious. We find the current form to be far clearer. Indeed, the example image should be updated to reflect the change.

You may find it interesting to view the real-time rendering of graphs in the distributed scheduler's graph view, where pointer hover provides more information about a given node and its current status.

like image 141
mdurant Avatar answered Sep 14 '26 01:09

mdurant