Skip to content

Commit 0af73d0

Browse files
committed
Detecting and appropriately warning about unconnected duplicate nodes
1 parent 32e724c commit 0af73d0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/pipeline/engine/workflows.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,13 @@ def _check_nodes(self, nodes):
700700
for node in nodes:
701701
if node.name in node_names:
702702
idx = node_names.index(node.name)
703-
if node_lineage[idx] in [node._hierarchy, self.name]:
704-
raise IOError('Duplicate node name %s found.' % node.name)
703+
try:
704+
this_node_lineage = node_lineage[idx]
705+
except IndexError:
706+
raise IOError('Duplicate and unconnected node name %s found.' % node.name)
707+
else:
708+
if this_node_lineage in [node._hierarchy, self.name]:
709+
raise IOError('Duplicate node name %s found.' % node.name)
705710
else:
706711
node_names.append(node.name)
707712

0 commit comments

Comments
 (0)