Skip to content

Commit 2e5436d

Browse files
committed
fix: one typo in error message, exit early if no connections are to be evaluated
1 parent d338ddd commit 2e5436d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

nipype/pipeline/engine/nodes.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -516,15 +516,20 @@ def _get_inputs(self):
516516
This mechanism can be easily extended/replaced to retrieve data from
517517
other data sources (e.g., XNAT, HTTP, etc.,.)
518518
"""
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
520524
return
521525

522526
prev_results = defaultdict(list)
523527
for key, info in list(self.input_source.items()):
524528
prev_results[info[0]].append((key, info[1]))
525529

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))
528533

529534
for results_fname, connections in list(prev_results.items()):
530535
outputs = None
@@ -535,7 +540,7 @@ def _get_inputs(self):
535540

536541
if outputs is None:
537542
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 \
539544
(%s) does not contain any outputs.""" % (self.name, results_fname))
540545

541546
for key, conn in connections:

0 commit comments

Comments
 (0)