Conditional node execution

20 views
Skip to first unread message

Fred Loney

unread,
Feb 4, 2013, 3:20:37 PM2/4/13
to nipy...@googlegroups.com
Is it possible to conditionally execute a node only if there are inputs? E.g. given a workflow:

workflow.connect([
   
(filter, process, [('out_files', 'in_files')]),
   
....

execute the process node if and only if filter.out_files is not empty. I tried a variation with iterators without success as well.

Thanks,

Fred

Satrajit Ghosh

unread,
Feb 6, 2013, 11:48:16 AM2/6/13
to nipy-user
hi fred,

we tend to let that branch of the graph crash, which will automatically prevent things that depend on the crashed node from executing, while allowing things that do not depend on the crashed node to continue executing. 

if you would like a more reasonable error message/send a notification, you can insert a function node in between those two nodes that sends does it's notification job and then crashes. 

we currently don't do any analysis on the data and then operate on the graph as we've tried to maintain a dissociation between data and code. similarly mapnodes only expand at the point of execution not earlier, because it cannot determine ahead of time how many data elements it will get.

hope that helps.

cheers,

satra

--
 
---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages