Skip to content

raw.get_data() should accept int64 #5977

Closed

Description

@skjerns

When loading a file to RawArray, the get_data() command does only accept int32, but should accept all ints, including int64, as this is the standard dtype for many numpy functions (e.g. np.argmax). It's a small change, I'll propose it.

Activity

  1. agramfort commented on Feb 21, 2019

    @agramfort
    SponsorMember
  2. skjerns commented on Feb 21, 2019

    @skjerns
    ContributorAuthor

    yes! sorry, should have done that initially:

    import numpy as np
    import mne
    from mne.datasets import sample
    
    data_path = sample.data_path()
    fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
    ch_idx= np.argmax([0,1,2,3,4])
    fif = mne.io.read_raw_fif(fname)
    data = fif.get_data(ch_idx)
    # TypeError: picks must be a list of int or list of str, got a data type of int64

    only happens with 0.18 dev version! 0.17 seems to be fine.

    btw 1.5GB for the sample data set is quite huge!

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions