Skip to content

"compute_current_source_density" on Epochs only works with preload=True (--> add to documentation) #7859

Closed

Description

@andrewsno1

[MNE v 0.20.5 on CentOS]

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.

Thanks!

Activity

  1. larsoner commented on Jun 2, 2020

    @larsoner
    Member

    @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?

  2. added this to the 0.21 milestone on Jun 2, 2020
  3. andrewsno1 commented on Jun 2, 2020

    @andrewsno1
    Author

    Sure, I will do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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