@@ -627,3 +627,35 @@ def sq(x):
627
627
joinfield = ['in1' ])
628
628
wf .connect (square , 'out' , square_join , "in1" )
629
629
wf .run ()
630
+
631
+
632
+ def test_join_nestediters (tmpdir ):
633
+ tmpdir .chdir ()
634
+
635
+ def exponent (x , p ):
636
+ return x ** p
637
+
638
+ wf = pe .Workflow ('wf' , base_dir = tmpdir .strpath )
639
+
640
+ xs = pe .Node (IdentityInterface (['x' ]),
641
+ iterables = [('x' , [1 , 2 ])],
642
+ name = 'xs' )
643
+ ps = pe .Node (IdentityInterface (['p' ]),
644
+ iterables = [('p' , [3 , 4 ])],
645
+ name = 'ps' )
646
+ exp = pe .Node (Function (function = exponent ), name = 'exp' )
647
+ exp_joinx = pe .JoinNode (Merge (1 , ravel_inputs = True ),
648
+ name = 'exp_joinx' ,
649
+ joinsource = 'xs' ,
650
+ joinfield = ['in1' ])
651
+ exp_joinp = pe .JoinNode (Merge (1 , ravel_inputs = True ),
652
+ name = 'exp_joinp' ,
653
+ joinsource = 'ps' ,
654
+ joinfield = ['in1' ])
655
+ wf .connect ([
656
+ (xs , exp , [('x' , 'x' )]),
657
+ (ps , exp , [('p' , 'p' )]),
658
+ (exp , exp_joinx , [('out' , 'in1' )]),
659
+ (exp_joinx , exp_joinp , [('out' , 'in1' )])])
660
+
661
+ wf .run ()
0 commit comments