-
Notifications
You must be signed in to change notification settings - Fork 98
WIP Rework mne bids path match #1355
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
WIP Rework mne bids path match #1355
Conversation
…h are not files. Are there more folders in different datatypes allowed?
|
Hello! 👋 Thanks for opening your first pull request here! |
412aaef to
09ba143
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1355 +/- ##
==========================================
+ Coverage 97.37% 97.41% +0.03%
==========================================
Files 40 40
Lines 8966 9008 +42
==========================================
+ Hits 8731 8775 +44
+ Misses 235 233 -2 ☔ View full report in Codecov by Sentry. |
|
thanks @waldie11! we have a bit of a backlog right now so please don't worry if we take a bit longer to get back to you. |
|
@sappelhoff happy new year! |
4863705 to
c71a41f
Compare
sappelhoff
left a comment
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.
Hey @waldie11 could you please add an example for the feature that you introduce? Either by modifying an actual example that already exists, or by adding a numpy docstr example below the ones that already exist.
Could you please also resolve the conflicts AND follow the steps for first time contributors here? -->#1354
102eb3d to
0480497
Compare
12c4f89 to
def6ab2
Compare
|
Hi @sappelhoff , I think the true meat is rather a rework of
(BIDS v1.8.0-1 p. 214) |
|
Idk how far you are interested in diving into this: in This benchmark is eating up some CI runtime though. I tried keeping it lightweight. |
66b4e1c to
824649e
Compare
|
I will make time for this in the next days, latest in the weekend, thanks for your patience! |
sappelhoff
left a comment
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.
Thanks for your work @waldie11! I left a few comments and suggestions to be addressed, but I think we can then go ahead and merge it!
mne_bids/tests/test_path.py
Outdated
| for i in equal_length_subj_ids(np.arange(1, 20, dtype=int)): | ||
| for j in range(1, 9): |
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.
where are the 20 and 9 coming from? as with the 17 above, better define these as variables within the test, potentially with a quick inline comment, or even better, a descriptive var name
n_test_subs = 20
...
mne_bids/tests/test_path.py
Outdated
| for datatype in ["eeg", "meg"]: | ||
| bids_subdir = BIDSPath( | ||
| subject=i, | ||
| session="0" + str(j), |
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.
please use f-string formatting whenever possible.
| # Clean up | ||
| shutil.rmtree(tmp_bids_root) |
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.
is this not done automatically by pytest?
970751c to
7399903
Compare
for more information, see https://pre-commit.ci
Co-authored-by: Stefan Appelhoff <[email protected]>
Co-authored-by: Stefan Appelhoff <[email protected]>
Co-authored-by: Stefan Appelhoff <[email protected]>
|
Thanks for your kind improvements @sappelhoff ! |
sappelhoff
left a comment
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.
Thanks for the contribution!
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
PR Description
When
_return_root_pathsnow usesignore_nosub, it can benefit from from only exploring directories withinroot/sub-*instead of exploring the whole tree and subsequently applying the regex filter on visited files.get_entity_valsis extended by an argumentinclude_matchto introduce a prefilter on regex path match. This is a whitelist approach, and extends both functionality and performance compared to a equivalent blacklist approach of existing optionignore_dirs.Merge checklist
Maintainer, please confirm the following before merging.
If applicable: