You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: bids_preproc() on a single .edf fails due to README.md in montages directory #26
eegprep.bids_preproc() throws a ValueError when processing EDF files because it attempts to validate all files in the resources/montages/ directory as .locs files, including the documentation README.md file that ships with the package.
Traceback (mostrecentcalllast):
File"/opt/miniforge3/envs/nbai_preproc/lib/python3.12/site-packages/eegprep/bids_preproc.py", line569, inbids_preprocEEG, import_report=pop_load_frombids(...)
File"/opt/miniforge3/envs/nbai_preproc/lib/python3.12/site-packages/eegprep/pop_load_frombids.py", line884, inpop_load_frombidsraiseValueError(f"Only montage files with the .locs extension are supported, "f"but found {filename}. These are MATLAB v7 .mat files; "f"please convert your montage into the appropriate format.")
ValueError: Onlymontagefileswiththe .locsextensionaresupported, butfoundREADME.md.
TheseareMATLABv7 .matfiles; pleaseconvertyourmontageintotheappropriateformat.
in eegprep/pop_load_frombids.py :
# Determine montage path and files to checkmontage_path=os.path.join(os.path.dirname(__file__), 'resources', 'montages')
# ... (path validation code)else:
# Use all available montage filesfilenames=sorted(os.listdir(montage_path))
forfilenameinfilenames:
ifnotfilename.endswith('.locs'):
raiseValueError(f"Only montage files with the .locs extension are supported, "f"but found {filename}. These are MATLAB v7 .mat files; "f"please convert your montage into the appropriate format.")
The issue: the code lists all files in the montages directory including README.md, then raises the error because the README is not a .locs file.
Potential Fix:
Filter for .locs files instead of raising an error on non-.locs files:
Activity
arnodelorme commentedon Nov 20, 2025
Fixed in d5ad950
Thanks for reporting.