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

[MRG] _return_root_paths now only looks in subfolders of root starting with 'sub-' #1253

Closed
wants to merge 7 commits into from
3 changes: 2 additions & 1 deletion mne_bids/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,8 @@ def _return_root_paths(root, datatype=None, ignore_json=True):
else:
paths = [p for p in paths if p.is_file()]

# only keep files which are of the form root/sub-*, such that we only look in 'sub'-folders
# only keep files which are of the form root/sub-*,
# such that we only look in 'sub'-folders:
kaare-mikkelsen marked this conversation as resolved.
Show resolved Hide resolved
root_sub = str(root / "sub-")
paths = [p for p in paths if str(p).startswith(root_sub)]

Expand Down
Loading