Skip to content

Commit fff2883

Browse files
authored
[FIX] Merge-tsv is now able to use caps option properly (aramis-lab#1535)
* Fix reduce issue * Fix check
1 parent 1718d8c commit fff2883

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

clinica/iotools/data_handling/_merging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ def _add_data_to_merge_file_from_caps(
330330
f"{pipeline.value} outputs were not found in the CAPS folder.",
331331
lvl="info",
332332
)
333-
334333
return _post_process_merged_df_from_caps(merged_df, merged_summary_df)
335334

336335

clinica/iotools/pipeline_handling.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,18 @@ def _get_single_record(
266266
atlas_path, pipeline, pvc_restriction, tracers_selection, atlas_selection
267267
)
268268
]
269-
return {
270-
**{"participant_id": participant_id, "session_id": session_id},
271-
**reduce(
272-
lambda a, b: {**a, **b},
273-
[
274-
_get_records_for_atlas(atlas, pipeline, metric, group_path.name)
275-
for atlas in atlases
276-
],
277-
),
278-
}
269+
if atlases:
270+
return {
271+
**{"participant_id": participant_id, "session_id": session_id},
272+
**reduce(
273+
lambda a, b: {**a, **b},
274+
[
275+
_get_records_for_atlas(atlas, pipeline, metric, group_path.name)
276+
for atlas in atlases
277+
],
278+
),
279+
}
280+
return {**{"participant_id": participant_id, "session_id": session_id}}
279281

280282

281283
def _get_atlas_paths(
@@ -351,8 +353,7 @@ def _skip_atlas_based_on_selection(
351353
) -> bool:
352354
"""Returns True if the atlas provided through its path should be skipped based on the user-provided selection."""
353355
return (
354-
atlas_selection is not None
355-
and _get_atlas_name(atlas_path, pipeline) not in atlas_selection
356+
atlas_selection and _get_atlas_name(atlas_path, pipeline) not in atlas_selection
356357
)
357358

358359

0 commit comments

Comments
 (0)