Skip to content

Deprecate unused LassoSelector event handlers. - #20603

Merged
timhoffm merged 1 commit into
matplotlib:masterfrom
anntzer:ls
Aug 15, 2021
Merged

timhoffm merged 1 commit into
matplotlib:masterfrom
anntzer:ls

Conversation

@anntzer

@anntzer anntzer commented Jul 8, 2021

Copy link
Copy Markdown
Contributor

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

timhoffm commented Jul 8, 2021

Copy link
Copy Markdown
Member

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

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

@anntzer

anntzer commented Jul 8, 2021

Copy link
Copy Markdown
Contributor Author

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

@ericpre ericpre left a comment

Copy link
Copy Markdown
Member

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

anntzer commented Jul 27, 2021

Copy link
Copy Markdown
Contributor Author

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

jklymak commented Aug 12, 2021

Copy link
Copy Markdown
Member

@ericpre is the above OK w/ you?

@ericpre ericpre left a comment

Copy link
Copy Markdown
Member

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