pyprep icon indicating copy to clipboard operation
pyprep copied to clipboard

Move from `pick_types` to `inst.pick`

Open sappelhoff opened this issue 1 year ago • 5 comments

See for example: https://github.com/sappelhoff/pyprep/blob/82390acff4c15a8e8ca92ed92c46f7a50d72e049/pyprep/find_noisy_channels.py#L57

This raises:

NOTE: pick_types() is a legacy function. New code should use inst.pick(...).

sappelhoff avatar Aug 14 '24 11:08 sappelhoff

Hello, This is my first PR, but I am confident I will be able to update the code. Can you assign this to me? and I will start working on it immediately.

Ayush-Devs avatar Aug 20 '24 12:08 Ayush-Devs

Hey @Ayush-Devs, sure -- please feel free to open a PR.

sappelhoff avatar Aug 20 '24 12:08 sappelhoff

The raw.pick() method returns the modified Raw object itself, not a numpy.ndarray like pick_types() used to.

if len(arys) == 1: result = asanyarray(arys[0])

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (60,) + inhomogeneous part.

not really sure how to work around this issue.

Ayush-Devs avatar Aug 25 '24 12:08 Ayush-Devs

Hey @Ayush-Devs, I am making quite a few changes in the background regarding the pyprep infrastructure right now, so it'd be good to not work on this for a while. I had assumed you closing your PR meant that.

sappelhoff avatar Aug 25 '24 13:08 sappelhoff

relevant:

  • https://github.com/mne-tools/mne-python/issues/11913

sappelhoff avatar Aug 26 '24 10:08 sappelhoff