raphaelvallat / yasa

YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
https://raphaelvallat.com/yasa/
BSD 3-Clause "New" or "Revised" License
417 stars 113 forks source link

Update mne.pick_channels() to mne.pick() #154

Closed sjg2203 closed 8 months ago

sjg2203 commented 8 months ago

Update mne.pick_channels() to mne.pick(), as mne.pick_channels() is a legacy function.

I wasn't sure how to deal with the changelog as I only updated mne.pick() which works just like mne.pick_channels().

@raphaelvallat, if you have a moment to review?

raphaelvallat commented 8 months ago

Unit tests are failing because pick does not have argument ordered=, unlike pick_channels:

>       raw_pick = raw.copy().pick(ch_names, ordered=True)
E       TypeError: pick() got an unexpected keyword argument 'ordered'

Could you verify on your own data that pick returns the channels in the specified order? (e.g. as if using .pick_channels(..., ordered=True)

sjg2203 commented 8 months ago

Just tested it and both returned the same. mne.pick() orders the channels based their order in ch_names. I removed ordered=True as it is not available in mne.pick()

Unit tests are failing because pick does not have argument ordered=, unlike pick_channels:

>       raw_pick = raw.copy().pick(ch_names, ordered=True)
E       TypeError: pick() got an unexpected keyword argument 'ordered'

Could you verify on your own data that pick returns the channels in the specified order? (e.g. as if using .pick_channels(..., ordered=True)

raphaelvallat commented 8 months ago

Thank you! Merging now