Skip to content

Deprecate unused LassoSelector event handlers. #20603

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

Merged
merged 1 commit into from
Aug 15, 2021
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 8, 2021

These are unused since 61ab6df (and have trivial replacements if
someone really wants to call them manually, which seems unlikely).

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

These are unused since 61ab6df (and have trivial replacements if
someone *really* wants to call them manually, which seems unlikely).
@anntzer anntzer added this to the v3.5.0 milestone Jul 8, 2021
@timhoffm
Copy link
Member

timhoffm commented Jul 8, 2021

Are we sure this is the direction we want to deprecate?

Most other event callbacks start with on though naming is not consistent.

@anntzer
Copy link
Contributor Author

anntzer commented Jul 8, 2021

I think we should move towards making all widget callbacks private, with the idea that the "correct" way to programatically interact with widgets is to send events to the canvas and just let the canvas' CallbackRegistry do the dispatching.

@jklymak jklymak requested a review from timhoffm July 20, 2021 15:47
Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is the direction we want to deprecate?

Most other event callbacks start with on though naming is not consistent.

It would be good to tidy up redundant callbacks, but maybe an alternative is to rename press and release to onpress and onrelease in _SelectorWidget?

@anntzer
Copy link
Contributor Author

anntzer commented Jul 27, 2021

rename press and release to onpress and onrelease in _SelectorWidget

That would be a bigger API break: anyone who was using press or release now has to change their code and version-gate, whereas with the change proposed here 1) likely they were using press or release to start with, as that's the only thing that worked for everything except LassoSelector, and 2) one can keep using press and release and have something that works for all versions.

... or, if we believe that the API break doesn't matter because no one is using the callbacks directly, we should (repeating myself) consider just making them private.

@jklymak
Copy link
Member

jklymak commented Aug 12, 2021

@ericpre is the above OK w/ you?

Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, renaming the press/release is a different discussion.

@timhoffm timhoffm merged commit 8851b51 into matplotlib:master Aug 15, 2021
@anntzer anntzer deleted the ls branch August 16, 2021 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants