From c6e8e6a364bac74b6274661e42932b4c67fc5c9d Mon Sep 17 00:00:00 2001 From: kaare-mikkelsen Date: Fri, 24 May 2024 14:33:22 +0200 Subject: [PATCH 1/4] _return_root_paths now only looks in subfolders of root starting with 'sub-' --- mne_bids/path.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mne_bids/path.py b/mne_bids/path.py index 101d2715c..7e192da29 100644 --- a/mne_bids/path.py +++ b/mne_bids/path.py @@ -2441,6 +2441,10 @@ 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 + root_sub=str(root / 'sub-') + paths = [p for p in paths if str(p).startswith(root_sub)] + return paths From ac8c0dc28f6862576381910d590ba40a961b9cb2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 12:47:19 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mne_bids/path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mne_bids/path.py b/mne_bids/path.py index 7e192da29..31f94c7dc 100644 --- a/mne_bids/path.py +++ b/mne_bids/path.py @@ -2441,8 +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 - root_sub=str(root / 'sub-') + # only keep files which are of the form root/sub-*, such that we only look in 'sub'-folders + root_sub = str(root / "sub-") paths = [p for p in paths if str(p).startswith(root_sub)] return paths From ba363c8c86927b5965f5e09d8267cc52eee81eef Mon Sep 17 00:00:00 2001 From: kaare-mikkelsen Date: Tue, 28 May 2024 14:32:28 +0200 Subject: [PATCH 3/4] changed length of l. 2444 --- mne_bids/path.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mne_bids/path.py b/mne_bids/path.py index 31f94c7dc..97e3a17c9 100644 --- a/mne_bids/path.py +++ b/mne_bids/path.py @@ -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: root_sub = str(root / "sub-") paths = [p for p in paths if str(p).startswith(root_sub)] From 9b50f6b6a06bbc716c00218b56299a6f8106834b Mon Sep 17 00:00:00 2001 From: kaare-mikkelsen Date: Tue, 28 May 2024 16:24:05 +0200 Subject: [PATCH 4/4] Update mne_bids/path.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Richard Höchenberger --- mne_bids/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mne_bids/path.py b/mne_bids/path.py index 97e3a17c9..f50417175 100644 --- a/mne_bids/path.py +++ b/mne_bids/path.py @@ -2442,7 +2442,7 @@ def _return_root_paths(root, datatype=None, ignore_json=True): 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: + # such that we only look in 'sub'-folders: root_sub = str(root / "sub-") paths = [p for p in paths if str(p).startswith(root_sub)]