I’m dealing with a large number of mne.io.RawArray
instances and need to keep track of the underlying files on disk.
I saw that RawArray
has an attribute filenames
which it inherits from mne.io.BaseRaw
, where it can be set via BaseRaw.__init__()
.
>>> from mne.io import BaseRaw
>>> print(BaseRaw.__doc__)
[...]
filenames : tuple
Tuple of length one (for unsplit raw files) or length > 1 (for split
raw files).
[...]
Unfortunately RawArray.__init__()
does not have the filenames
argument, doesn’t allow setting filenames
directly and also doesn’t expose a setter for it:
>>> type(raw)
mne.io.array.array.RawArray
>>> raw.filenames = ("test.xyz",)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[38], line 1
----> 1 raw.filenames = ("test.xyz",)
AttributeError: can't set attribute
I can set RawArray._filenames
to achieve the desired effect:
>>> raw._filenames = ("test.xyz",)
>>> raw.filenames
('test.xyz',)
But as one should generally avoid interacting with private attributes directly, I’m wondering if there is a proper way to achive the desired effect with RawArray
.