Skip to content

Commit fc27d01

Browse files
committed
added a step to make sure output IDs are unique in case output name is the same as an input name
1 parent 7c7d462 commit fc27d01

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

nipype/utils/nipype2boutiques.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,16 @@ def get_boutiques_output(name, interface, tool_inputs, verbose=False):
182182
"""
183183
output = {}
184184
output['name'] = name.replace('_', ' ').capitalize()
185-
output['id'] = name
185+
186+
# Check if the output name was already used as an input name
187+
# If so, append '_outfile' to the end of the ID
188+
unique_id = True
189+
for inp in tool_inputs:
190+
if inp['id'] == name:
191+
unique_id = False
192+
break
193+
output['id'] = name if unique_id else name + '_outfile'
194+
186195
output['path-template'] = ""
187196
output[
188197
'optional'] = True # no real way to determine if an output is always produced, regardless of the input values.

0 commit comments

Comments
 (0)