-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ENH: Make _pick_to_idx public #11913
Comments
I would like to rework the channel selection/pick API with the following goal in mind:
After going through
Both
I'm not sure if
Simultaneously, I would also deprecate for good the legacy
The removal of the existing public pick methods in I believe I have the time to work on this change before 1.7 is out, but let's take the time to think about the API first ;) |
Without getting into too much detail, I would add to the priority list above:
In theory any new functionality like Beyond that I would suggest breaking this up as much as possible, otherwise the diff and review will be unmanageable. Hardest starting point (but maybe most satisfying?) might be to try to simplify the internal code to be more DRY. Simplest might be with something like implementing a There are a lot of details to work out with the above proposal, so I suggest @drammock and others who are interested first comment as well on the general idea, then @mscheltienne you propose what a first PR could include, then once we converge on that you can open it. That way we don't have to discuss everything all at once but can make incremental progress with a shared vision. For me I'm overall +1 on these ideas subject to my suggestion to prefer |
I'll take a deeper look at the proposal soon, but meanwhile I'm adding a crossref to #11531 and especially #11531 (comment) |
With the proposed approach, we can keep most, if nit all functions with the legacy decorator. I agree we should break things apart. I propose to get a first PR with some minor changes and the structure of the new functions, i. e. function names, arguments and type-hints for the arguments and returns. We can iterate on the structure before coding the logic. |
regarding pick_info
another possibility that occurs to me here is that my_info = raw.info
# ...many lines later:
my_info.pick() # modifies `raw` (possibly unwittingly) So I think we should avoid that. And obviously we can't modify an attached
or an option where regarding functions selecting on a list-like of channel namesYou'll see in #11531 (comment) that I advocated for regarding pick and excludeMaybe I'm misunderstanding but you seem to suggest that it will be possible to pass |
For For
I believe @jasmainak and @agramfort were not advocating against
I usually agree and prefer to split functionalities, but here it doesn't seem that difficult. If a string is provided, is it a channel name? is it a channel type? is it a valid regex? We could even drop this last point by supporting For |
Originally posted by @larsoner in #11903 (comment)
We'll have to think about the right API and we might not want to expose all options but it should be doable
The text was updated successfully, but these errors were encountered: