mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

DOC: Clarify read_raw_nirx expects directory path, not file path

Open natinew77-creator opened this issue 1 month ago • 0 comments

Summary

This PR improves the documentation for read_raw_nirx to prevent the common "OSError: Need a directory for fname but found a file..." error that users encounter when passing a single file path instead of a directory path.

Addresses #13353

Changes

mne/io/nirx/nirx.py

  • Added a note in the read_raw_nirx docstring explaining the directory requirement
  • Clarified that passing a file path will result in an error
  • Added suggestion to use read_raw_snirf for .snirf files

tutorials/io/30_reading_fnirs_data.py

  • Added an important note in the fNIRS tutorial with:
    • Correct vs incorrect usage examples
    • Troubleshooting guidance for the OSError
    • Alternative for SNIRF format files

Testing

Documentation-only change. No new tests required.This improves the documentation for read_raw_nirx to prevent the common 'OSError: Need a directory for fname but found a file' error that users encounter when passing a single file path instead of a directory path.

Changes:

  • Added a note in the read_raw_nirx docstring explaining the directory requirement and suggesting read_raw_snirf for .snirf files
  • Added an important note in the fNIRS tutorial with correct/incorrect examples and troubleshooting guidance

Fixes #13353

Reference issue (if any)

What does this implement/fix?

Additional information

natinew77-creator avatar Dec 11 '25 20:12 natinew77-creator