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.
Adapted from code by @thht in mne-tools/mne-bids#1310 (comment)
The code above will fail with
raw.saveI think. We should validate theinfo["subject_info]"dict like we do forInfo. There are maybe some otherinfofields we should protect at some point but maybe YAGNI andsubject_infoseems 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
Infowe do list what is considered user-modifiable and what is not, but I need to look.