Skip to content

Data unit 'A.U.' is not supported by newest update of MNE #14520

Open

Description

@alfredcurry

Description of the problem

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

Activity

  1. scott-huberty commented on Nov 11, 2026

    @scott-huberty
    Contributor

    RuntimeError: The data unit 'A.U.' is not supported by MNE. Please report this error as a GitHub issue to inform the developers.

    This error is confusing, because MNE does generally support arbitary unit data, e.g. here:

    misc="AU",

    fnirs_td_gated_amplitude="AU", # counts
    fnirs_td_moments_intensity="AU", # counts

    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

  2. viranovskaya commented on Nov 12, 2026

    @viranovskaya
    Contributor

    Hi! Have you already started working on this? If not, would it be okay if I took it on?

  3. alfredcurry commented on Nov 12, 2026

    @alfredcurry
    Author

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions