@@ -516,15 +516,20 @@ def _get_inputs(self):
516
516
This mechanism can be easily extended/replaced to retrieve data from
517
517
other data sources (e.g., XNAT, HTTP, etc.,.)
518
518
"""
519
- if self ._got_inputs :
519
+ if self ._got_inputs : # Inputs cached
520
+ return
521
+
522
+ if not self .input_source : # No previous nodes
523
+ self ._got_inputs = True
520
524
return
521
525
522
526
prev_results = defaultdict (list )
523
527
for key , info in list (self .input_source .items ()):
524
528
prev_results [info [0 ]].append ((key , info [1 ]))
525
529
526
- logger .debug ('[Node] Setting %d connected inputs from %d previous nodes.' ,
527
- len (self .input_source ), len (prev_results ))
530
+ logger .debug (
531
+ '[Node] Setting %d connected inputs of node "%s" from %d previous nodes.' ,
532
+ len (self .input_source ), self .name , len (prev_results ))
528
533
529
534
for results_fname , connections in list (prev_results .items ()):
530
535
outputs = None
@@ -535,7 +540,7 @@ def _get_inputs(self):
535
540
536
541
if outputs is None :
537
542
raise RuntimeError ("""\
538
- Error populating the inpus of node "%s": the results file of the source node \
543
+ Error populating the inputs of node "%s": the results file of the source node \
539
544
(%s) does not contain any outputs.""" % (self .name , results_fname ))
540
545
541
546
for key , conn in connections :
0 commit comments