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
Data unit 'A.U.' is not supported by newest update of MNE #14520
When trying to load a CW fNIRS snirf file with the latest verions (1.13) I get this error message: RuntimeError: The data unit 'A.U.' is not supported by MNE. Please report this error as a GitHub issue to inform the developers. This was not an issue in 1.12. I traced the issue to _get_dataunit_scaling of mne.io.snirf._snirf.py, where 'A.U.':'arbitrary units' does not have a unit specified, so it throws the error. I suggest adding to line 695, where if no unit is given then a scaling of 1.0 is assigned. I suggest changing the line from if unit == "": -> if unit == "" or unit.lower() == 'a.u.': to catch this and similar cases.
Steps to reproduce
read_raw_snirf(snirf_file, preload=True)
Link to data
No response
Expected results
load successfully
Actual results
throws error RuntimeError: The data unit 'A.U.' is not supported by MNE. Please report this error as a GitHub issue to inform the developers.
Additional information
In latest version 1.3.2. Not present in earlier version 1.12.1
I suggest adding to line 695, where if no unit is given then a scaling of 1.0 is assigned. I suggest changing the line from if unit == "": -> if unit == "" or unit.lower() == 'a.u.': to catch this and similar cases.
This sounds reasonable to me!
cc @jcrdubois , looks like they added the error message that you are reporting, in #1398
Activity
scott-huberty commentedon Nov 11, 2026
This error is confusing, because MNE does generally support arbitary unit data, e.g. here:
mne-python/mne/defaults.py
Line 54 in a43fb22
mne-python/mne/defaults.py
Lines 68 to 69 in a43fb22
This sounds reasonable to me!
cc @jcrdubois , looks like they added the error message that you are reporting, in #1398
viranovskaya commentedon Nov 12, 2026
Hi! Have you already started working on this? If not, would it be okay if I took it on?
alfredcurry commentedon Nov 12, 2026
I have tested that line change I suggested in my own download, but haven't made a pull request to update the actual repo. You are welcome to do it