-
Notifications
You must be signed in to change notification settings - Fork 85
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
MRG: In BIDSPath, don't infer the datatype from the suffix #1030
Conversation
6ebf4d0
to
2fe2b3e
Compare
I needed to set datatype to None to make `find_emptyroom()` deal with the inheritance principle correctly, but turns out it never took effect because `BIDSPath.update()` would silently replace my `datatype=None` with an inferred `datatype='meg'`.
2fe2b3e
to
d812b2a
Compare
Codecov Report
@@ Coverage Diff @@
## main #1030 +/- ##
=======================================
Coverage 95.18% 95.18%
=======================================
Files 25 25
Lines 3777 3778 +1
=======================================
+ Hits 3595 3596 +1
Misses 182 182
Help us with your feedback. Take ten seconds to tell us how you rate us. |
This PR is a blocker for mne-tools/mne-bids-pipeline#576 |
@@ -1237,14 +1233,15 @@ def _parse_ext(raw_fname): | |||
return fname, ext | |||
|
|||
|
|||
def _infer_datatype_from_path(fname): | |||
def _infer_datatype_from_path(fname: Path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is used by get_bids_path_from_fname()
IMHO it's doing too much magic too, but here I only ensured it keeps on working
Thanks @hoechenberger |
) * Updated the BIDSPath in-place update example I updated the `BIDSPath` in-place update example to perhaps make it clearer to users what in-place updating means. It's a small change, but should make the message clearer. * Missing printout in BIDSPath example and indentation * Remove additional tab at EOL * Added datatype to BIDSPath update after #1030 Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org> * Added BHV name to CITATION.cff Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
I needed to set datatype to None to make
find_emptyroom()
deal with the inheritance principle correctly, but turns out it never took effect becauseBIDSPath.update()
would silently replace mydatatype=None
with an inferreddatatype='meg'
.This PR stops this automated inference.
This will likely break user code, but it's the right thing to do as we've been trying to be too clever in the past.
Merge checklist
Maintainer, please confirm the following before merging: