mne-tools / mne-bids-pipeline

Automatically process entire electrophysiological datasets using MNE-Python.
https://mne.tools/mne-bids-pipeline/
BSD 3-Clause "New" or "Revised" License
134 stars 65 forks source link

MAINT: Deduplicate filename decisions based on step choices #844

Open larsoner opened 6 months ago

larsoner commented 6 months ago

this is the third time I've seen the same inline "filt-or-regress" if-else. Makes me worry about forgetting to copy it where it's needed, when adding new code. Not sure if there is a sensible way to reduce that cognitive overhead / duplication that wouldn't feel over-engineered, though.

_Originally posted by @drammock in https://github.com/mne-tools/mne-bids-pipeline/pull/840#discussion_r1480010865_

There are other places where this happens, too, like in the filtering step where you need to triage based on whether or not SSS was used. It would be good if there were a standard way of handling this triaging. We have some helpers along these lines for picking "all raw data runs" (e.g., whether noise or rest needs to be processed in addition to task runs) so maybe we can do something similar that looks at cfg.spatial_filter, cfg.maxwell_filter etc.