Skip to content
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

BUG: subject_info dict validation #12874

Closed
larsoner opened this issue Sep 26, 2024 · 0 comments · Fixed by #12875
Closed

BUG: subject_info dict validation #12874

larsoner opened this issue Sep 26, 2024 · 0 comments · Fixed by #12875
Milestone

Comments

@larsoner
Copy link
Member

larsoner commented Sep 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant