diff --git a/xcp_d/utils/utils.py b/xcp_d/utils/utils.py index 5f7640f03..42de61d43 100644 --- a/xcp_d/utils/utils.py +++ b/xcp_d/utils/utils.py @@ -563,3 +563,8 @@ def _make_dictionary(metadata=None, **kwargs): def _out_file_to_source(in_file, dataset_name, dataset_path): bids_uri = [f"bids:{dataset_name}:{str(Path(in_file).relative_to(dataset_path))}"] return bids_uri + + +def _transpose_lol(lol): + """Transpose list of lists.""" + return list(map(list, zip(*lol))) diff --git a/xcp_d/workflows/concatenation.py b/xcp_d/workflows/concatenation.py index 1d6157b8b..93c809bce 100644 --- a/xcp_d/workflows/concatenation.py +++ b/xcp_d/workflows/concatenation.py @@ -12,7 +12,7 @@ FilterOutFailedRuns, ) from xcp_d.utils.doc import fill_doc -from xcp_d.utils.utils import _make_dictionary, _select_first +from xcp_d.utils.utils import _make_dictionary, _select_first, _transpose_lol from xcp_d.workflows.plotting import init_qc_report_wf @@ -311,7 +311,11 @@ def init_concatenate_data_wf( name="make_timeseries_dict", iterfield=["Sources"], ) - workflow.connect([(timeseries_src, make_timeseries_dict, [("bids_uris", "Sources")])]) + # fmt:off + workflow.connect([ + (timeseries_src, make_timeseries_dict, [(("bids_uris", _transpose_lol), "Sources")]), + ]) + # fmt:on ds_timeseries = pe.MapNode( DerivativesDataSink(