Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

mne-bids cannot find split files saved with split_naming="bids" when the name has desc

Aperta
#14,431 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@BabaSanfour ci sta già lavorando.

Dal 19/10/2026.

  • #14434 di @BabaSanfour — aperta

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

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

BUG
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")) writes sub-01_task-rest_desc-base_split-01_eeg.fif.
  • mne-bids (BIDSPath(..., split="01")) names it sub-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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mne-tools/mne-python

Tutte le issue di mne-tools/mne-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.