Move BIDS cache lock file to code/ folder for BIDS validator compliance#986
Move BIDS cache lock file to code/ folder for BIDS validator compliance#986
code/ folder for BIDS validator compliance#986Conversation
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
code/ folder for BIDS validator compliance
|
This way you will collapse sessions names, no? Please fix this @copilot |
|
Please check the failed tests and doc, an fix @copilot |
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
Fixed in 7e253b7. Lock files are now written per-session: |
|
Fix the what's new file please @copilot |
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
Fixed in f3f2e6b. The |
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
|
There something failing here within the logic, please review and explain why @codex: FAILED moabb/tests/test_datasets.py::Test_Datasets::test_cache_dataset[p300] - FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-runner/pytest-0/test_cache_dataset_p300_0/MNE-BIDS-fake-dataset-p300-10-2--60-60--120-120--fake1-fake2-fake3--c3-cz-c4/sub-1/ses-0/code/sub-1_ses-0_desc-b4504c97daf59839737e9dc787a42b46_lockfile.json' |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d20b644048
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
moabb/datasets/bids_interface.py
Outdated
| description=self.desc, | ||
| check=False, | ||
| ) | ||
| session_path.rm(safe_remove=False) |
There was a problem hiding this comment.
Avoid broad rm() that captures code/ lock files
Using session_path.rm(safe_remove=False) with only subject/session/description now also matches the new per-session lock file stored in root/code/. For those matches, mne_bids reconstructs BIDSPath.fpath under sub-*/ses-*/code/... before unlinking, so it tries to delete a path that was never created and raises FileNotFoundError (this is exactly what breaks test_cache_dataset[p300] during cache overwrite).
Useful? React with 👍 / 👎.
|
@copilot address the last comments please |
Co-authored-by: bruAristimunha <42702466+bruAristimunha@users.noreply.github.com>
Fixed in 3f6acda. The root cause: in some mne_bids versions,
Addressed in 3f6acda — see the comment above for the detailed explanation. |
lock_filefrom BIDS subject folder to{root}/code/folder (BIDS-validator exempt)sub-{subject}_ses-{session}_desc-{hash}_lockfile.json) to avoid collapsing session names_migration_lock_filefor backward compat with intermediate per-subject code/ lock files_legacy_lock_filefor backward compat with original BIDS subject-folder lock filesload()to check per-session lock files (fall back to legacy/migration for backward compat)save()to write one lock file per session after saving all runs for that sessionerase()to remove lock files BEFORE callingsession_path.rm()— in some mne_bids versions,rm()globs all files in root, finds lock files by BIDS entity name pattern, derives a wrong canonical path, and fails withFileNotFoundErrordocs/source/whats_new.rstOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.