File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
nipype/interfaces/utility/tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 88from nipype .interfaces import utility
99import nipype .pipeline .engine as pe
1010
11+ concat_sort = """\
12+ def concat_sort(in_arrays):
13+ import numpy as np
14+ all_vals = np.concatenate([arr.flatten() for arr in in_arrays])
15+ return np.sort(all_vals)
16+ """
1117
1218def test_function (tmpdir ):
1319 os .chdir (str (tmpdir ))
@@ -27,6 +33,12 @@ def increment_array(in_array):
2733 f2 = pe .MapNode (utility .Function (function = increment_array ), name = 'increment_array' , iterfield = ['in_array' ])
2834
2935 wf .connect (f1 , 'random_array' , f2 , 'in_array' )
36+
37+ f3 = pe .Node (
38+ utility .Function (function = concat_sort ),
39+ name = "concat_sort" )
40+
41+ wf .connect (f2 , 'out' , f3 , 'in_arrays' )
3042 wf .run ()
3143
3244
You can’t perform that action at this time.
0 commit comments