Skip to content

Commit

Permalink
Merge pull request #49 from brianzi/master
Browse files Browse the repository at this point in the history
allow setting parents while adding a node
  • Loading branch information
AdriaanRol authored Oct 1, 2017
2 parents 2b3b725 + b46dbeb commit bec23aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autodepgraph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def snapshot(self, update=False):
snap['nodes'][node.name] = node.snapshot(update=update)
return snap

def add_node(self, node):
def add_node(self, node, parents=None):
"""
Adds a node to the graph.
Args:
Expand All @@ -108,6 +108,9 @@ def add_node(self, node):
self._node_pos = None
self._graph_changed_since_plot = True

if parents is not None:
node.parents(parents)

return node

def clear_node_state(self):
Expand Down

0 comments on commit bec23aa

Please sign in to comment.