@@ -58,15 +58,20 @@ def test_pipeline_execution(
5858 # Get missing subjects
5959 missing_subjects = set ()
6060 for file in runner .get_missing_first_level_outputs ():
61- missing_subjects .add (get_subject_id (file ))
61+ subject_id = get_subject_id (file )
62+ if subject_id is not None :
63+ missing_subjects .add (subject_id )
6264
6365 # Leave if no missing subjects
6466 if not missing_subjects :
6567 break
6668
6769 # Start pipeline
6870 runner .subjects = missing_subjects
69- runner .start (True , False )
71+ try : # This avoids errors in the workflow to make the test fail
72+ runner .start (True , False )
73+ except (RuntimeError ) as err :
74+ print ('RuntimeError: ' , err )
7075
7176 # Check missing files for the last time
7277 missing_files = runner .get_missing_first_level_outputs ()
@@ -80,15 +85,15 @@ def test_pipeline_execution(
8085
8186 # Indices and keys to the unthresholded maps
8287 indices = list (range (1 , 18 , 2 ))
83- keys = [f'hypo{ i } _unthresh.nii.gz' for i in range (1 , 10 )]
8488
8589 # Retrieve the paths to the reproduced files
8690 reproduced_files = runner .pipeline .get_hypotheses_outputs ()
8791 reproduced_files = [reproduced_files [i ] for i in indices ]
8892
8993 # Retrieve the paths to the results files
9094 collection = ResultsCollection (team_id )
91- results_files = [join (collection .directory , collection .files [k ]) for k in keys ]
95+ results_files = [join (collection .directory , f ) for f in collection .files .keys ()]
96+ results_files = [results_files [i ] for i in indices ]
9297
9398 # Compute the correlation coefficients
9499 return [
@@ -142,10 +147,10 @@ def test_pipeline_evaluation(team_id: str):
142147
143148 for subjects in [20 , 40 , 60 , 80 , 108 ]:
144149 # Execute pipeline
145- results = helpers . test_pipeline_execution (team_id , subjects )
150+ results = test_pipeline_execution (team_id , subjects )
146151
147152 # Compute correlation with results
148- passed = helpers . test_correlation_results (results , subjects )
153+ passed = test_correlation_results (results , subjects )
149154
150155 # Write values in a file
151156 with open (file_name , 'a' , encoding = 'utf-8' ) as file :
0 commit comments