You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"compute_current_source_density" on Epochs only works with preload=True (--> add to documentation) #7859
When I tried using mne.preprocessing.compute_current_source_density on an Epochs instance execution failed in line 167 with the classic
TypeError: 'NoneType' object is not iterable
because inst._data was None.
This happens when the Epochs object is created without using "preload=True".
An easy quick fix would be to add a sentence to the docstring explaining that the "Epochs" object needs to be created using preload=True. I think this would save the users some time debugging.
@andrewsno1 I think the fix here is to use _check_preloaded (you can see how it's used elsewhere in our codebase). Would you be up for making a PR to add it?
Activity
larsoner commentedon Jun 2, 2020
@andrewsno1 I think the fix here is to use
_check_preloaded(you can see how it's used elsewhere in our codebase). Would you be up for making a PR to add it?andrewsno1 commentedon Jun 2, 2020
Sure, I will do it!