mne-bids cannot find split files saved with split_naming="bids" when the name has desc
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- bioinformatics
Direzione di ricerca
Start with the split-name construction in mne/_fiff/utils.py, referenced by Raw.save and Epochs.save, and compare it with the BIDS entity-order rules. Run the provided mne-bids reproduction to confirm that generated names cannot be found by find_matching_paths. Done means split filenames place the split entity according to BIDS ordering and a regression test verifies that MNE-generated parts are discoverable, including names with descriptions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description of the problem
split_naming="bids" (in Raw.save and Epochs.save) inserts split-XX just before the suffix: https://github.com/mne-tools/mne-python/blob/8f498626a53704a6a96bcd8a11e22cbd8866efa5/mne/_fiff/utils.py#L322-L335
mne-bids on the other hand does it differently. Order of entities in file names is defined in src/schema/rules/entities.yaml and it defines split before description.
I checked BIDS (split and entities) and men-bids is the correct one.
so for the same file :
- MNE
(raw.save(..., split_naming="bids"))writessub-01_task-rest_desc-base_split-01_eeg.fif. - mne-bids
(BIDSPath(..., split="01"))names itsub-01_task-rest_split-01_desc-base_eeg.fif.
I also found out that split also comes before recording but mne-bids and bids do it the other way round, however this is less of an issue as both agree.
the outcome is that mne-bids can't find MNE's parts: find_matching_paths returns [] for them, so a split derivative can't be found or read through mne-bids.
Steps to reproduce
import tempfile
from pathlib import Path
import mne
import numpy as np
from mne_bids import BIDSPath, find_matching_paths
root = Path(tempfile.mkdtemp())
info = mne.create_info(4, 100.0, "eeg")
raw = mne.io.RawArray(np.zeros((4, 300_000)), info)
path = BIDSPath(
root=root,
subject="01",
task="rest",
description="base",
datatype="eeg",
suffix="eeg",
extension=".fif",
check=False,
).mkdir()
raw.save(path.fpath, split_size="2MB", split_naming="bids")
# name MNE wrote for the first part
print(sorted(p.name for p in path.fpath.parent.glob("*.fif"))[0])
# name BIDS (and mne-bids) expect for the first part
print(path.copy().update(split="01").basename)
# mne-bids does not find MNE's parts
print(find_matching_paths(root, extensions=".fif"))
Output:
sub-01_task-rest_desc-base_split-01_eeg.fif
sub-01_task-rest_split-01_desc-base_eeg.fif
[]
Link to data
No response
Expected results
sub-01_task-rest_split-01_desc-base_eeg.fif
Actual results
sub-01_task-rest_desc-base_split-01_eeg.fif
Additional information
Platform macOS-26.6.2-arm64-arm-64bit-Mach-O
Python 3.14.3 (v3.14.3:323c59a5e34, Feb 3 2026, 11:41:37) [Clang 16.0.0 (clang-1600.0.26.6)]
Executable /Users/hamzaabdelhedi/Projects/packages/coco-pipe/.venv/bin/python3
CPU Apple M1 Pro (8 cores)
Memory 16.0 GiB
Core
├☑ mne 1.13.2 (unable to check for latest version on GitHub, SSL error)
├☑ numpy 2.5.4 (Accelerate, threads not introspectable)
├☑ scipy 1.18.1
└☑ matplotlib 3.11.2 (backend=macosx)
Numerical (optional)
├☑ scikit-learn 1.9.1
├☑ threadpoolctl 3.7.0
├☑ numba 0.68.0
├☑ pandas 3.0.6
├☑ h5py 3.15.1
└☐ unavailable nibabel, nilearn, dipy, openmeeg, python-picard, jamica, cupy, h5io
Visualization (optional)
└☐ unavailable pyvista, pyvistaqt, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser, ipywidgets, trame, trame_client, trame_server, trame_pyvista, trame_vtk, trame_vuetify
Ecosystem (optional)
├☑ mne-bids 0.20.0
└☐ unavailable mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, autoreject, neo, eeglabio, edfio, curryreader, mffpy, pybv, pymef, antio, defusedxml
- Lingua principale
- Python
- Stelle
- 3.5k
- Fork
- 1.6k
- Merge medio
- 1g 2h
- PR unite (30g)
- 72
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mne-tools/mne-python
-
ENH: Add `description` filter parameter to `Raw.crop_by_annotations()`Forse già presa @aman-coder03 l’ha presa 196 giorni fa. ApertaENH
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mne-tools/mne-python#13743 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
mne-tools/mne-python#14428 ·
I maintainer di solito rispondono entro 1 giorno
-
ENH
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
mne-tools/mne-python#14427 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Possible scaling error for 0 and Nyquist frequencies in multitaper spectraForse già presa @badrisatyam1-ctrl l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
mne-tools/mne-python#14426 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
BUG
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
mne-tools/mne-python#14421 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di mne-tools/mne-python
Issue simili
-
get_page_thumbnail modifies cached page images, affecting later thumbnails and picture exportsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
docling-project/docling-mcp#147 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
autowarefoundation/autoware_carla_scenario#405 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mohitmishra786/readprism#322 ·
I maintainer di solito rispondono entro 1 giorno