@@ -834,33 +834,6 @@ def _check_is_already_connected(workflow, node, attrname):
834
834
835
835
return True
836
836
837
- def _get_parameter_node (self , parameter , subtype = "in" ):
838
- """Returns the underlying node corresponding to an input or
839
- output parameter
840
- """
841
- attrlist = parameter .split ("." )
842
- _ = attrlist .pop () # take attribute name
843
- nodename = attrlist .pop ()
844
-
845
- targetworkflow = self
846
- while attrlist :
847
- workflowname = attrlist .pop (0 )
848
- workflow = None
849
- for node in targetworkflow ._graph .nodes ():
850
- if node .name == workflowname and isinstance (node , Workflow ):
851
- workflow = node
852
- break
853
- if workflow is None :
854
- return
855
- targetworkflow = workflow
856
-
857
- for node in targetworkflow ._graph .nodes ():
858
- if node .name == nodename :
859
- if isinstance (node , Workflow ):
860
- return
861
- else :
862
- return node
863
-
864
837
def _check_outputs (self , parameter ):
865
838
return self ._has_attr (parameter , subtype = "out" )
866
839
@@ -989,7 +962,7 @@ def _generate_flatgraph(self):
989
962
logger .debug ("in: connections-> %s" , str (d ["connect" ]))
990
963
for cd in deepcopy (d ["connect" ]):
991
964
logger .debug ("in: %s" , str (cd ))
992
- dstnode = node ._get_parameter_node ( cd [ 1 ], subtype = "in" )
965
+ dstnode = node .get_node ( parameter . rsplit ( "." , 1 )[ 0 ] )
993
966
srcnode = u
994
967
srcout = cd [0 ]
995
968
dstin = cd [1 ].split ("." )[- 1 ]
@@ -1009,7 +982,7 @@ def _generate_flatgraph(self):
1009
982
parameter = cd [0 ][0 ]
1010
983
else :
1011
984
parameter = cd [0 ]
1012
- srcnode = node ._get_parameter_node (parameter , subtype = "out" )
985
+ srcnode = node .get_node (parameter . rsplit ( "." , 1 )[ 0 ] )
1013
986
if isinstance (cd [0 ], tuple ):
1014
987
srcout = list (cd [0 ])
1015
988
srcout [0 ] = parameter .split ("." )[- 1 ]
0 commit comments