-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MRG: Allow str list in picks #4511
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
Conversation
|
quite a few red lines ... thx @larsoner for taking a stab at this so quickly |
Codecov Report
@@ Coverage Diff @@
## master #4511 +/- ##
==========================================
+ Coverage 88.73% 88.75% +0.01%
==========================================
Files 401 401
Lines 72354 72422 +68
Branches 12154 12122 -32
==========================================
+ Hits 64205 64278 +73
- Misses 5214 5218 +4
+ Partials 2935 2926 -9 |
|
Would presumably simplify stuff like this https://github.com/mne-tools/mne-python/blob/master/mne/viz/evoked.py#L1272 and this https://github.com/mne-tools/mne-python/blob/master/mne/viz/evoked.py#L1613 |
|
This is a great idea! Let me know if you need help. |
|
Do you want to take over? It would probably get done faster that way |
|
FYI @cbrnr I'm going to try to come back to this this week |
|
I'm going to move this to 0.17. It's not really a blocker and we might want to get some mileage out of testing it before springing it on folks. |
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.
Okay @agramfort I think the API proposal is complete now. Hopefully it's clear from the updated docstring and examples. Can you take a look?
I have only updated docstrings in one file (epochs.py) so we can converge on it. Once that's done I'll do the terrible task of trying to change them everywhere in the codebase. Eventually everything should use _picks_to_idx and I've changed a number of them, but not all.
|
@cbrnr do you have time to take a look? |
|
@jona-sassenhagen do you have time to look at the docstring for |
|
I don't have time to go through the code at the moment, but I was wondering how you deal with ambiguity. For example, what if I have a channel labeled Also, in case this PR requires the channel type mapping, it would be great if it didn't make de-duplicating this mapping any more difficult (#4851). |
|
It will throw an error and the user can use a more specific function |
|
This one is a bit too invasive to squeeze in just before release, better to make it an early 0.18 enhancement |
|
@jona-sassenhagen @cbrnr @mmagnuski are you still interested in this option? If so, let me know if you're happy with the docstring above. If not, I can close. |
|
@larsoner I'm very interested, sorry I didn't respond earlier, I'll take a look tomorrow! |
|
BTW, this will definitely improve my teaching experience. For some reason many of my students had problems remembering about |
|
no more objection on this in 2019 for me :) but you need to rebase @larsoner |
|
This is ready for review/merge from my end. |
|
Travis complains: but that's likely unrelated? Besides, 👍 |
|
@massich can you take a look and merge if you're happy? I think everyone was happy with the API, and the last commits were just about rebasing and filling out the doc using |
massich
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 opinions here and there. Thx @larsoner the code is much more readable.
Maybe instead of 'code titles' I would prefer them to be private functions somewhere, or something. But they are fine.
WIP as proof of concept including changes tomne/vizfunctions (and a few other misc ones) as requested by @agramfort.Assuming people are convinced, need to do:
_picks_to_idxpickslogicdoccerdepending on MAINT: DRY our docstrings #5753Closes #4502.