From 79a1ad67d71bcb19567adc8835e3f2e664208690 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 7 Feb 2024 15:31:59 +0100 Subject: [PATCH] fix failing test --- bids/ext/reports/parsing.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bids/ext/reports/parsing.py b/bids/ext/reports/parsing.py index 4160bf1..b59522b 100644 --- a/bids/ext/reports/parsing.py +++ b/bids/ext/reports/parsing.py @@ -315,10 +315,16 @@ def parse_files( mri_scanner_info_done = False for group in data_files: - if not mri_scanner_info_done and group[0].entities["datatype"] in mri_datatypes: + if group[0].entities["datatype"] not in mri_datatypes: + continue + + # assume all MRI data was acquires on the same scanner + if not mri_scanner_info_done: description_list.append(mri_scanner_info(group)) mri_scanner_info_done = True + group_description = "" + if group[0].entities["datatype"] == "func": group_description = func_info(group, config, layout) @@ -351,6 +357,8 @@ def parse_files( if group[0].entities["datatype"] in mri_datatypes: continue + group_description = "" + if group[0].entities["datatype"] in [ "eeg", "meg", @@ -362,11 +370,9 @@ def parse_files( "microscopy", ]: LOGGER.warning(f" '{group[0].entities['datatype']}' not yet supported.") - group_description = "" else: LOGGER.warning(f" '{group[0].filename}' not yet supported.") - group_description = "" description_list.append(group_description)