Skip to content

Dask Placeholder object needs its own visualize() method #175

@seibert

Description

@seibert

The default visualize() method in Dask uses circles for function nodes, which creates several with our current visualization of Metagraph DAGs (described below). We could fix this with our own visualize() method, and we could also add in some special features along the way.

The problem with circles for function nodes is that severely limits the length of the label unless you want to have function nodes which take up a disproportionally large area in the drawing of the DAG. To work around this limitation, we've forced our longer labels into the rectangular data nodes, which results in a confusing diagram. Data nodes contain labels describing translations (like NumpyNodeMapType->PythonNodeMapType) or algorithm names (like util.nodemap.apply), when those labels should be on the function nodes that precede the data node.

Ideally, data nodes should be labeled with the concrete data type whenever possible. Additionally, we can add some special kwargs to our custom visualize() to do things like:

  • Color code all the nodes compilable by a specific plugin
  • Run the optimizer in read-only mode and highlight the compilable subgraphs, each in a different color
  • Expand the label on each node to indicate which plugin the algorithm or translator came from

We can do this customization by constructing and passing function_attributes and data_attributes dictionaries to the underlying dask visualize() method that override the default node styles, colors and labels.

We will also need to provide this visualize() method as a standalone function for use in larger DAGs where the final node is not a Metagraph placeholder object, but something else that will have the standard visualize() method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions