-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MRG: Deprecrate pick channels in info #10039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MRG: Deprecrate pick channels in info #10039
Conversation
|
To give some context, I wanted to see if |
|
Doc build failure doesn't seem to be related to this PR. |
larsoner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor stuff, thanks for taking care of this @mscheltienne !
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
Thanks for the tips, let's see if CIs are green; I wasn't quite sure on how the deprecated decorator works (especially as it doesn't throw any warning at me in the IPython console). |
| self['ch_names'] = [ch['ch_name'] for ch in self['chs']] | ||
| self['nchan'] = len(self['chs']) | ||
|
|
||
| @deprecated('use inst.pick_channels instead.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just automagically work. If it doesn't, I'll push a commit to fix the decorator (it's possible it has some bug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CIs are happy, so all good I guess, but I don't get any warning issued when using a function decorated with @deprecated in python console or in Spyder's IPython console. The docstring is edited however with .. warning:: DEPRECATED:. Is this the correct behavior for this decorator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot replicate; on your branch I get:
>>> import mne
>>> import warnings
>>> warnings.simplefilter('always', DeprecationWarning)
>>> info = mne.create_info(2, 1000., 'eeg')
>>> info.pick_channels(info['ch_names'][:1])
<decorator-gen-25>:4: DeprecationWarning: Function pick_channels is deprecated; use inst.pick_channels instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the warning as well on this mac laptop.. I guess the problem is with my windows computer and the venv.
|
Thanks @mscheltienne ! |
Follow up on the discussion in #10035