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] BIDSPath to allow users to turn off entity check, and replace all make_bids_basename with BIDSPath #511
Conversation
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
==========================================
+ Coverage 92.74% 92.82% +0.07%
==========================================
Files 14 14
Lines 2026 2020 -6
==========================================
- Hits 1879 1875 -4
+ Misses 147 145 -2
Continue to review full report at Codecov.
|
what we do in mne-study-template is that we do it via update that does not check. If you go this route with a check param/attribute it's probably more explicit. @hoechenberger wdyt? |
I think it's good to have the |
Also this makes me wonder, maybe we can drop |
it's true that if we have this check param then there is no difference
between BIDSPath init and the make_bids_basename function that can
go...
|
Do we want a deprecation cycle, or just axe it now? |
I believe we're breaking so much in the next release already that we don't need to care about deprecation cycles 😁 But we could also follow a slightly different approach: make |
I like @hoechenberger 's idea |
Just to outline the idea in more detail:
This will allow us to be more flexible and potentially change internals in the future without breaking backward-compatibility. |
on second thoughts whether you rename to |
what bothers me is that make_bids_path will basically call the BIDSPath
constructor without doing anything more.
I often say that objects are harder to use for newcomers than plain
functions but here I am not sure it's worth
having a function. Well documenting how to use BIDSPath object which is
starting to become the core swiss army knife of mne-bids seems a smarter
move
my 2c
… |
Ok so then I'd like to revise my proposal and I'd say let's drop make_bids_basename and add check=True to BIDSPath :) |
So this is pretty much good to go once CI is green. It is the first installment of the 3-tiered PR, proposed in: #492 (comment) |
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
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.
@hoechenberger @jasmainak @sappelhoff ok for you?
fetch the branch and try to remove it to see if necessary
… |
You mean … WORK MYSELF? Daaamn… ok, will do :) |
you can do it I am sure :)
|
test_get_matched_emptyroom_no_meas_date() fails with check=False, need to figure out why.
e7e25c8 makes it such that we don't fall back to an empty-room's I'm starting to like not trying to be clever. |
Good to go from my end. |
@sappelhoff @jasmainak do you want to have a look? |
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.
LGTM :)
Awesome work, @adam2392! |
As pointed out by @sappelhoff in mne-tools#511 (comment), the presence of the attribute could lead to unexpected behavior. My solution is to just drop it and expect users to pass it to `BIDSPath.update()` if they want to disable checking during an update.
Turns out, empty-room recording sessions SHOULD be the recording date, but not MUST. This reverts e7e25c8 of mne-toolsGH-511
Turns out, empty-room recording sessions SHOULD be the recording date, but not MUST. This reverts e7e25c8 of mne-toolsGH-511
Sorry for my silence, I trust that the PR was in good hands ;) |
PR Description
Closes #510
make_bids_basename
completely per discussion below in favor ofBIDSPath
.check
kwarg toBIDSPath.__init__()
andBIDSPath.update()
functions._convert_str_to_BIDSPath()
function to handle the necessary converting from strings toBIDSPath
objects.The next PR
kind
->suffix
and addmodality
in favor ofkind
.fpath
functionality to replaceget_bids_fname
Merge checklist
Maintainer, please confirm the following before merging: