Skip to content

Commit aab06f5

Browse files
FredLoneysatra
FredLoney
authored andcommitted
Support synchronize iterables tuple values.
1 parent 8ee3ea3 commit aab06f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

nipype/pipeline/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -801,18 +801,18 @@ def _standardize_iterables(node):
801801
# The candidate iterable fields
802802
fields = set(node.inputs.copyable_trait_names())
803803

804+
# Synchronize iterables can be in [fields, value tuples] format
805+
# rather than [(field, value list), (field, value list), ...]
806+
if node.synchronize and len(iterables) == 2:
807+
first, last = iterables
808+
if all((isinstance(item, str) and item in fields
809+
for item in first)):
810+
iterables = _transpose_iterables(first, last)
804811
# Convert a tuple to a list
805812
if isinstance(iterables, tuple):
806813
iterables = [iterables]
807814
# Convert a list to a dictionary
808815
if isinstance(iterables, list):
809-
# Synchronize iterables can be in [fields, value tuples] format
810-
# rather than [(field, value list), (field, value list), ...]
811-
if node.synchronize and len(iterables) == 2:
812-
first, last = iterables
813-
if all((isinstance(item, str) and item in fields
814-
for item in first)):
815-
iterables = _transpose_iterables(first, last)
816816
# Validate the format
817817
for item in iterables:
818818
try:

0 commit comments

Comments
 (0)