Skip to content
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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

waldie11
Copy link

PR Description

The workflow of using pathlib.Path.rglob and subsequently filtering i.e. by each path starting with root/sub-* is rather non-performant, especially on polluted storage trees.

For starters, by using glob.glob recursively directly, it is possible to apply this filter equivalent immediately.

In an extension, I am suggesting to introduce the option of include_match to get_entity_vals.

Open to suggestions, or stripping this down.

Remark: I failed to join the CI as my email adress is considered work mail for some reason by MS.

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

Copy link

welcome bot commented Dec 18, 2024

Hello! 👋 Thanks for opening your first pull request here!
Please read the contributor guide, and please follow the steps outlined in the "Instructions for first-time contributors" section therein. ❤️ We will try to get back to you soon. 🚴🏽‍♂️

pyproject.toml Outdated
@@ -52,6 +52,7 @@ doc = [
"numpydoc",
"openneuro-py",
"pandas",
"pathlib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's part of the standard library and doesn't need to be listed here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, this comes up though 🤔

/home/circleci/project/mne_bids/path.py:docstring of mne_bids.BIDSPath.root:1: WARNING: py:class reference target not found: pathlib._local.Path [ref.class]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1358 (comment) . #1353 includes a work around for this but hasn't been merged yet

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 97.40%. Comparing base (46f284b) to head (4863705).

Files with missing lines Patch % Lines
mne_bids/path.py 75.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1355      +/-   ##
==========================================
- Coverage   97.43%   97.40%   -0.04%     
==========================================
  Files          40       40              
  Lines        8903     8912       +9     
==========================================
+ Hits         8675     8681       +6     
- Misses        228      231       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants