Skip to content

BUG: subject_info dict validation #12874

@larsoner

Description

@larsoner

The thing is, I can do something like this:

raw = mne.io.read_raw('valid_data.fif');
raw.info['subject_data']['weight'] = np.array([np.random.rand((200, 20))])

...

Adapted from code by @thht in mne-tools/mne-bids#1310 (comment)

The code above will fail with raw.save I think. We should validate the info["subject_info]" dict like we do for Info. There are maybe some other info fields we should protect at some point but maybe YAGNI and subject_info seems like a clearly good target since we know people change it.

We should also document that it can be changed if we don't already. I think in the docstring of Info we do list what is considered user-modifiable and what is not, but I need to look.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions