Skip to content

Conversation

@larsoner
Copy link
Member

@larsoner larsoner commented Aug 22, 2017

WIP as proof of concept including changes to mne/viz functions (and a few other misc ones) as requested by @agramfort.

Assuming people are convinced, need to do:

  • complete tests for _picks_to_idx
  • update the introduction (or other?) tutorial
  • properly document options
  • go through codebase and unify all picks logic
  • make CIs happy
  • finalize docstring via feedback
  • replace all XXX with finalized docstring, or use doccer depending on MAINT: DRY our docstrings #5753

Closes #4502.

@larsoner larsoner added this to the 0.16 milestone Aug 22, 2017
@agramfort
Copy link
Member

quite a few red lines ... thx @larsoner for taking a stab at this so quickly

@codecov-io
Copy link

codecov-io commented Aug 22, 2017

Codecov Report

Merging #4511 into master will increase coverage by 0.01%.
The diff coverage is 99.04%.

@@            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

@jona-sassenhagen
Copy link
Contributor

@cbrnr
Copy link
Contributor

cbrnr commented Mar 30, 2018

This is a great idea! Let me know if you need help.

@larsoner
Copy link
Member Author

Do you want to take over? It would probably get done faster that way

@larsoner
Copy link
Member Author

larsoner commented Apr 2, 2018

FYI @cbrnr I'm going to try to come back to this this week

@larsoner
Copy link
Member Author

larsoner commented Apr 3, 2018

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 larsoner modified the milestones: 0.16, 0.17 Apr 3, 2018
Copy link
Member Author

@larsoner larsoner left a 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.

@larsoner
Copy link
Member Author

larsoner commented Aug 1, 2018

@cbrnr do you have time to take a look?

@larsoner
Copy link
Member Author

larsoner commented Aug 5, 2018

@jona-sassenhagen do you have time to look at the docstring for picks with these changes?

@cbrnr
Copy link
Contributor

cbrnr commented Aug 6, 2018

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 eeg and I want to pick it (instead of picking all channels with type eeg)?

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).

@larsoner
Copy link
Member Author

larsoner commented Aug 6, 2018

It will throw an error and the user can use a more specific function

@larsoner
Copy link
Member Author

larsoner commented Oct 4, 2018

This one is a bit too invasive to squeeze in just before release, better to make it an early 0.18 enhancement

@larsoner larsoner modified the milestones: 0.17, 0.18 Oct 4, 2018
@larsoner larsoner changed the title WIP: Allow str list in picks RFC: Allow str list in picks Nov 28, 2018
@larsoner
Copy link
Member Author

@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.

@mmagnuski
Copy link
Member

@larsoner I'm very interested, sorry I didn't respond earlier, I'll take a look tomorrow!

@mmagnuski
Copy link
Member

BTW, this will definitely improve my teaching experience. For some reason many of my students had problems remembering about epochs.ch_names.index(ch_name) and even more when should be a list comprehension. :)

@agramfort
Copy link
Member

no more objection on this in 2019 for me :)

but you need to rebase @larsoner

@larsoner larsoner mentioned this pull request Feb 5, 2019
4 tasks
@larsoner larsoner changed the title RFC: Allow str list in picks MRG: Allow str list in picks Feb 13, 2019
@larsoner
Copy link
Member Author

This is ready for review/merge from my end.

@mmagnuski
Copy link
Member

Travis complains:

python setup.py check --restructuredtext --strict
running check
make[1]: Leaving directory '/home/travis/build/mne-tools/mne-python'
Makefile:126: recipe for target 'pep' failed
make: *** [pep] Error 2

but that's likely unrelated?

Besides, 👍 fill_doc to the rescue! 🚀 :)

@larsoner
Copy link
Member Author

@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 doccer.

@larsoner larsoner requested a review from massich February 13, 2019 16:50
Copy link
Contributor

@massich massich left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants