nilearn / nilearn

Machine learning for NeuroImaging in Python
http://nilearn.github.io
Other
1.15k stars 582 forks source link

`first_level_from_bids` should throw warnings and not errors when failing to process one subject if some files are missing #4332

Open Remi-Gau opened 4 months ago

Remi-Gau commented 4 months ago

Is the problem that your code then just errors and does not proceed to the next subject in your dataset? If that's the case, I should probably change some of the errors thrown by first_level_from_bids into warnings.

Originally posted by @Remi-Gau in https://github.com/nilearn/nilearn/issues/4280#issuecomment-1958915631

Remi-Gau commented 4 months ago

If a dataset has 10 subjects and subject 02 is missing some files (say some events.tsv) and first_level_from_bids will loop over all subjects but won't proceed further than subject 02 because it will throw an error.

A nicer behavior would be to :

bthirion commented 4 months ago

I understand well the use case and you're probably right. Still, I'm wondering whether this will not "hide" issues for users. People don't care much about warnings...

Remi-Gau commented 4 months ago

Yeah I am not 100% sure about this either.

Especially that the function allows you to select which subject to run this on, so you can always "skip" problematic subjects manually.

I'd say that given this is not mission critical, let's wait until we get more complaints on this before changing this. But at least there will be an issue where we can collects complaints and grievances.