datawork.api.graph

Node class and associated graph traversal functionality.

class datawork.api.graph.Node[source]

Abstract node class.

ancestors()[source]

Return ancestry tree of node.

This method works by recursively calling itself on all parents of each Node, which themselves are assumed to be Nodes.

Returns:anc – list of (object, ancestor tree) pairs.
Return type:list
parents()[source]

Return list of parent ‘None’ objects upon which this object depends.

datawork.api.graph.compute_dag(outputs)[source]

Compute a directed acyclic graph with the given outputs.

datawork.api.graph.extract_config(g)[source]

Extract dictionary with all configuration options found in graph.

datawork.api.graph.extract_inputs(g)[source]

Extract Data nodes that have no “Provides” in-neighbors.

datawork.api.graph.extract_tools(g)[source]

Given a graph, pull out all configurable Tools.

datawork.api.graph.fill_graph(g, o)[source]

Add given node to graph and all ancestors.

datawork.api.graph.node_label(obj)[source]

Compute a node label for this object.

datawork.api.graph.unique_objects(l)[source]

Given list of objects, ensure that they are all distinct python objects.

datawork.api.graph.visualize(g, filename, outputs)[source]

Draw computation DAG using graphviz.