I’m trying to combine a series of text files. The problem is that I’m getting the files from different nodes. My script looks something like this:
A = Node(CreateFilesA(out_names=['file1','file2']), name="A")
B = Node(CreateFilesB(out_names=['file3']), name="B")
The idea is to pass file1
(from node A
) and file
3 (from node B
) to another node:
def fun(*files):
list_of_files = files
return list_of_files
grabfiles = Node(Function(function='fun', input_names=['files'], output_names= "list_of_files"), name = "grabfiles")
The problem is that I can only connect grabfiles
once, so the following code fails
wf.connect([\
(A, "file1", grabfiles, "files"),\
(B, "file3", grabfiles, "files")]) #grabfiles already connected
so I’m wondering whether there is a workaround to this problem.