-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOC: Clarify read_raw_nirx expects directory path, not file path #13541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
DOC: Clarify read_raw_nirx expects directory path, not file path #13541
Conversation
7b109c6 to
a680ff4
Compare
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 mne-tools#13353
Address review comments from @larsoner: move directory clarification to Notes section in read_raw_nirx and remove redundant warning in tutorial.
This ensures the clarification appears in both read_raw_nirx and RawNIRX documentation while maintaining cleaner docstring code.
Incorporated feedback to format the directory requirement as a proper admonition note.
a680ff4 to
8cf299e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the documentation for read_raw_nirx to clarify that it expects a directory path (or header file path within that directory), addressing a common user error where single file paths cause an OSError.
Key changes:
- Enhanced the
fnameparameter description inread_raw_nirxto explicitly state it accepts a directory or.hdrfile path - Added a note in the shared docstring explaining the directory requirement and suggesting
read_raw_snirffor.snirffiles
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
mne/utils/docs.py |
Added a note to the nirx_notes docstring clarifying the directory requirement for fname and suggesting an alternative for .snirf files |
mne/io/nirx/nirx.py |
Updated the fname parameter description to explicitly explain it accepts a directory containing NIRX files or the .hdr header file within that folder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR improves the documentation for
read_raw_nirxto clarify that it expects a directory path (or a header file path within that directory), addressing common user confusion that can lead to an OSError.Addresses #13353
Changes
fnameparameter description inread_raw_nirxto explicitly mention directory paths or the.hdrheader file.mne/utils/docs.py.