@@ -11799,7 +11799,7 @@ <h1 id="JoinNode">JoinNode<a class="anchor-link" href="#JoinNode">¶</a></h1
11799
11799
</ div >
11800
11800
< div class ="inner_cell ">
11801
11801
< div class ="text_cell_render border-box-sizing rendered_html ">
11802
- < h2 id ="Simple-example "> Simple example< a class ="anchor-link " href ="#Simple-example "> ¶</ a > </ h2 > < p > Let's consider the very simple example depicted at the top of this page:</ p >
11802
+ < h2 id ="Simple-example "> Simple example< a class ="anchor-link " href ="#Simple-example "> ¶</ a > </ h2 > < p > Let's consider the very simple example depicted at the top of this page (since < code > A </ code > is not defined, the cell will crash if you try to run) :</ p >
11803
11803
11804
11804
</ div >
11805
11805
</ div >
@@ -11809,7 +11809,7 @@ <h2 id="Simple-example">Simple example<a class="anchor-link" href="#Simple-examp
11809
11809
< div class ="prompt input_prompt "> In [ ]:</ div >
11810
11810
< div class ="inner_cell ">
11811
11811
< div class ="input_area ">
11812
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="kn "> import</ span > < span class ="n "> Node</ span > < span class ="p "> ,</ span > < span class ="n "> JoinNode</ span > < span class ="p "> ,</ span > < span class ="n "> Workflow</ span >
11812
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="k "> import</ span > < span class ="n "> Node</ span > < span class ="p "> ,</ span > < span class ="n "> JoinNode</ span > < span class ="p "> ,</ span > < span class ="n "> Workflow</ span >
11813
11813
11814
11814
< span class ="c1 "> # Specify fake input node A</ span >
11815
11815
< span class ="n "> a</ span > < span class ="o "> =</ span > < span class ="n "> Node</ span > < span class ="p "> (</ span > < span class ="n "> interface</ span > < span class ="o "> =</ span > < span class ="n "> A</ span > < span class ="p "> (),</ span > < span class ="n "> name</ span > < span class ="o "> =</ span > < span class ="s2 "> "a"</ span > < span class ="p "> )</ span >
@@ -11865,8 +11865,8 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11865
11865
< div class ="prompt input_prompt "> In [ ]:</ div >
11866
11866
< div class ="inner_cell ">
11867
11867
< div class ="input_area ">
11868
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="kn "> import</ span > < span class ="n "> JoinNode</ span > < span class ="p "> ,</ span > < span class ="n "> Node</ span > < span class ="p "> ,</ span > < span class ="n "> Workflow</ span >
11869
- < span class ="kn "> from</ span > < span class ="nn "> nipype.interfaces.utility</ span > < span class ="kn "> import</ span > < span class ="n "> Function</ span > < span class ="p "> ,</ span > < span class ="n "> IdentityInterface</ span >
11868
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="k "> import</ span > < span class ="n "> JoinNode</ span > < span class ="p "> ,</ span > < span class ="n "> Node</ span > < span class ="p "> ,</ span > < span class ="n "> Workflow</ span >
11869
+ < span class ="kn "> from</ span > < span class ="nn "> nipype.interfaces.utility</ span > < span class ="k "> import</ span > < span class ="n "> Function</ span > < span class ="p "> ,</ span > < span class ="n "> IdentityInterface</ span >
11870
11870
</ pre > </ div >
11871
11871
11872
11872
</ div >
@@ -11879,8 +11879,8 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11879
11879
< div class ="prompt input_prompt "> In [ ]:</ div >
11880
11880
< div class ="inner_cell ">
11881
11881
< div class ="input_area ">
11882
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="c1 "> # Create iteration node</ span >
11883
- < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="kn "> import</ span > < span class ="n "> IdentityInterface</ span >
11882
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="c1 "> # Create iteration node</ span >
11883
+ < span class ="kn "> from</ span > < span class ="nn "> nipype</ span > < span class ="k "> import</ span > < span class ="n "> IdentityInterface</ span >
11884
11884
< span class ="n "> iternode</ span > < span class ="o "> =</ span > < span class ="n "> Node</ span > < span class ="p "> (</ span > < span class ="n "> IdentityInterface</ span > < span class ="p "> (</ span > < span class ="n "> fields</ span > < span class ="o "> =</ span > < span class ="p "> [</ span > < span class ="s1 "> 'number_id'</ span > < span class ="p "> ]),</ span >
11885
11885
< span class ="n "> name</ span > < span class ="o "> =</ span > < span class ="s2 "> "iternode"</ span > < span class ="p "> )</ span >
11886
11886
< span class ="n "> iternode</ span > < span class ="o "> .</ span > < span class ="n "> iterables</ span > < span class ="o "> =</ span > < span class ="p "> [(</ span > < span class ="s1 "> 'number_id'</ span > < span class ="p "> ,</ span > < span class ="p "> [</ span > < span class ="mi "> 1</ span > < span class ="p "> ,</ span > < span class ="mi "> 4</ span > < span class ="p "> ,</ span > < span class ="mi "> 9</ span > < span class ="p "> ])]</ span >
@@ -11896,9 +11896,9 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11896
11896
< div class ="prompt input_prompt "> In [ ]:</ div >
11897
11897
< div class ="inner_cell ">
11898
11898
< div class ="input_area ">
11899
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="c1 "> # Create join node - compute square root for each element in the joined list</ span >
11899
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="c1 "> # Create join node - compute square root for each element in the joined list</ span >
11900
11900
< span class ="k "> def</ span > < span class ="nf "> compute_sqrt</ span > < span class ="p "> (</ span > < span class ="n "> numbers</ span > < span class ="p "> ):</ span >
11901
- < span class ="kn "> from</ span > < span class ="nn "> math</ span > < span class ="kn "> import</ span > < span class ="n "> sqrt</ span >
11901
+ < span class ="kn "> from</ span > < span class ="nn "> math</ span > < span class ="k "> import</ span > < span class ="n "> sqrt</ span >
11902
11902
< span class ="k "> return</ span > < span class ="p "> [</ span > < span class ="n "> sqrt</ span > < span class ="p "> (</ span > < span class ="n "> e</ span > < span class ="p "> )</ span > < span class ="k "> for</ span > < span class ="n "> e</ span > < span class ="ow "> in</ span > < span class ="n "> numbers</ span > < span class ="p "> ]</ span >
11903
11903
11904
11904
< span class ="n "> joinnode</ span > < span class ="o "> =</ span > < span class ="n "> JoinNode</ span > < span class ="p "> (</ span > < span class ="n "> Function</ span > < span class ="p "> (</ span > < span class ="n "> input_names</ span > < span class ="o "> =</ span > < span class ="p "> [</ span > < span class ="s1 "> 'numbers'</ span > < span class ="p "> ],</ span >
@@ -11919,7 +11919,7 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11919
11919
< div class ="prompt input_prompt "> In [ ]:</ div >
11920
11920
< div class ="inner_cell ">
11921
11921
< div class ="input_area ">
11922
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="c1 "> # Create the workflow and run it</ span >
11922
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="c1 "> # Create the workflow and run it</ span >
11923
11923
< span class ="n "> joinflow</ span > < span class ="o "> =</ span > < span class ="n "> Workflow</ span > < span class ="p "> (</ span > < span class ="n "> name</ span > < span class ="o "> =</ span > < span class ="s1 "> 'joinflow'</ span > < span class ="p "> )</ span >
11924
11924
< span class ="n "> joinflow</ span > < span class ="o "> .</ span > < span class ="n "> connect</ span > < span class ="p "> (</ span > < span class ="n "> iternode</ span > < span class ="p "> ,</ span > < span class ="s1 "> 'number_id'</ span > < span class ="p "> ,</ span > < span class ="n "> joinnode</ span > < span class ="p "> ,</ span > < span class ="s1 "> 'numbers'</ span > < span class ="p "> )</ span >
11925
11925
< span class ="n "> res</ span > < span class ="o "> =</ span > < span class ="n "> joinflow</ span > < span class ="o "> .</ span > < span class ="n "> run</ span > < span class ="p "> ()</ span >
@@ -11937,12 +11937,12 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11937
11937
< div class ="prompt "> </ div >
11938
11938
11939
11939
< div class ="output_subarea output_stream output_stdout output_text ">
11940
- < pre > 170306 -22:38:22,861 workflow INFO:
11940
+ < pre > 170715 -22:55:10,963 workflow INFO:
11941
11941
Workflow joinflow settings: ['check', 'execution', 'logging']
11942
- 170306 -22:38:22,871 workflow INFO:
11942
+ 170715 -22:55:10,997 workflow INFO:
11943
11943
Running serially.
11944
- 170306 -22:38:22,873 workflow INFO:
11945
- Executing node joinnode in dir: /tmp/tmpm8NCMb /joinflow/joinnode
11944
+ 170715 -22:55:10,999 workflow INFO:
11945
+ Executing node joinnode in dir: /tmp/tmp0mqxl90s /joinflow/joinnode
11946
11946
</ pre >
11947
11947
</ div >
11948
11948
</ div >
@@ -11966,7 +11966,7 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11966
11966
< div class ="prompt input_prompt "> In [ ]:</ div >
11967
11967
< div class ="inner_cell ">
11968
11968
< div class ="input_area ">
11969
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="n "> res</ span > < span class ="o "> .</ span > < span class ="n "> nodes</ span > < span class ="p "> ()[</ span > < span class ="mi "> 0</ span > < span class ="p "> ]</ span > < span class ="o "> .</ span > < span class ="n "> result</ span > < span class ="o "> .</ span > < span class ="n "> outputs</ span >
11969
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="n "> res</ span > < span class ="o "> .</ span > < span class ="n "> nodes</ span > < span class ="p "> ()[</ span > < span class ="mi "> 0</ span > < span class ="p "> ]</ span > < span class ="o "> .</ span > < span class ="n "> result</ span > < span class ="o "> .</ span > < span class ="n "> outputs</ span >
11970
11970
</ pre > </ div >
11971
11971
11972
11972
</ div >
@@ -11998,7 +11998,7 @@ <h2 id="More-realistic-example">More realistic example<a class="anchor-link" hre
11998
11998
< div class ="prompt input_prompt "> In [ ]:</ div >
11999
11999
< div class ="inner_cell ">
12000
12000
< div class ="input_area ">
12001
- < div class =" highlight hl-ipython2 "> < pre > < span > </ span > < span class ="n "> res</ span > < span class ="o "> .</ span > < span class ="n "> nodes</ span > < span class ="p "> ()[</ span > < span class ="mi "> 0</ span > < span class ="p "> ]</ span > < span class ="o "> .</ span > < span class ="n "> inputs</ span >
12001
+ < div class =" highlight hl-ipython3 "> < pre > < span > </ span > < span class ="n "> res</ span > < span class ="o "> .</ span > < span class ="n "> nodes</ span > < span class ="p "> ()[</ span > < span class ="mi "> 0</ span > < span class ="p "> ]</ span > < span class ="o "> .</ span > < span class ="n "> inputs</ span >
12002
12002
</ pre > </ div >
12003
12003
12004
12004
</ div >
0 commit comments