-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Allow returning candidate BIDSPaths #1083
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1083 +/- ##
=======================================
Coverage 95.19% 95.19%
=======================================
Files 24 24
Lines 3847 3853 +6
=======================================
+ Hits 3662 3668 +6
Misses 185 185
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I don't understand why we need this? We can already enforce to use the sidecar only. If that fails, we can call the function again without that restriction, and it will find a candidate empty-room recording based on recording dates. Why do we need more than that? |
Let's only consider this use case -- where the sidecar isn't there -- for now since it's the only case that matters for this functionality. In MNE-BIDS-Pipeline, we use file-based caching. For this to work, we need to know all input files that affect a given function. We want to process empty-room data. To do this, we call But to cache this step -- i.e., to know that You could imagine a dataset update to any one of the existing empty-room files in an OpenNeuro dataset ("oops I date-shifted incorrectly!"), or adding a new empty-room file ("oops I forgot to include this in v1.0!") could change the |
(Conceptually as well -- this just shows "behind the curtain" of the somewhat magical empty-room matching algorithm, so it's nice in terms of transparency to say "if you want to know what files we considered, here they are".) |
Thanks for the explanation, this makes sense! |
@larsoner can you just update what’s new ? |
Done! |
Thanks @larsoner 🚀 |
For MNE-BIDS-Pipeline, we want to know the set of input files that each function uses during each step. In one step, we call
raw_bids_path.find_empty_room()
, which could use the sidecar or traverse a bunch of files (potentially) to find the best-matching empty-room file. This PR adds areturn_candidates=False
kwarg that will returnNone
if the sidecar was used, or a list ofBIDSPath
instances if files were traversed.