flow/network: require ActorNode be passed to add_connection
This commit is contained in:
parent
b0b0380ea7
commit
9af87367eb
|
@ -53,10 +53,8 @@ class DataFlowGraph(MultiDiGraph):
|
||||||
def add_connection(self, source_node, sink_node,
|
def add_connection(self, source_node, sink_node,
|
||||||
source_ep=None, sink_ep=None, # default: assume nodes have 1 source/sink and use that one
|
source_ep=None, sink_ep=None, # default: assume nodes have 1 source/sink and use that one
|
||||||
source_subr=None, sink_subr=None): # default: use whole record
|
source_subr=None, sink_subr=None): # default: use whole record
|
||||||
if not isinstance(source_node, ActorNode):
|
assert(isinstance(source_node, ActorNode))
|
||||||
source_node = ActorNode(source_node)
|
assert(isinstance(sink_node, ActorNode))
|
||||||
if not isinstance(sink_node, ActorNode):
|
|
||||||
sink_node = ActorNode(sink_node)
|
|
||||||
self.add_edge(source_node, sink_node,
|
self.add_edge(source_node, sink_node,
|
||||||
source=source_ep, sink=sink_ep,
|
source=source_ep, sink=sink_ep,
|
||||||
source_subr=source_subr, sink_subr=sink_subr)
|
source_subr=source_subr, sink_subr=sink_subr)
|
||||||
|
|
Loading…
Reference in New Issue