-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: Deprecate idle_event and remove it from all but wx backends #4544
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
@@ -2331,6 +2331,10 @@ def on_press(event): | |||
cid = canvas.mpl_connect('button_press_event', on_press) | |||
|
|||
""" | |||
if s == 'idle_event': | |||
warnings.warn("idle_event is only implemented for the wx backend, " | |||
"and will be removed in matplotlib 2.0. Use the " |
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.
Can you bump this to 2.1? I want to hold the line that the only API changes in 2.0 will be style changes.
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.
Should this not use a MatplotlibDeprecationWarning from https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/cbook.py#L37 ?
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.
Yes, to what @jenshnielsen is asking.
For reference it seems this has been non-functional in tk + qt since 83b71a8 (JDH in June 2008). There may be other uses for idle event, for example an alternate way to deal with the auto-redrawing of stale figures is to stick a On the other hand, this has never been functional and no one has complained so there probably is not much demand for it. Some code also needs to be removed from the qt4/qt5 backends. This needs an entry in doc/dev/api_changes. |
This commit removes code related to `idle_event` in the gtk backend, where it caused spurious warnings, and adds a deprecation warning on any use of idle_event. Idle event still works in wx for now. Fixes #4534.
Update: Added an entry to doc/dev/api_changes, removed some code from qt4/qt5 backends, and updated deprecation warning to 2.1. @jenshnielsen and @tacaswell, I'm not sure I understood your comments about MatplotlibDeprecationWarning. That's the same as mplDeprecation I have currently, isn't it? The code removal from qt5/qt4 was very minimal, but I don't see anythign else related to idle_event. (There is code related to draw_idle, but that is different than idle_event). |
I would normally use it as here https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/delaunay/triangulate.py#L14 |
The reason to use the version of the deprecation warning in cbook rather than the built-in warnings is that by default the built-in warnings are suppressed, where as the warnings in cbook are by default visible. |
@ahaldane Can you not rebase/squash every time? It makes it hard to keep track of and sometimes the path we took to get from point A to point B is useful for forensics later. |
updated to use Sorry for squashing before, it's just a habit from other repositories. |
Thanks, no worries about the habits from other projects. I will let this sit a bit longer and plan to merge this tonight. |
We should probably remove the example(s) using idle_event as well then... |
@OceanWolf The only example I can find that uses |
Ahh, sorry, I missed it because I expected to see the entire example deleted. I don't understand why we need to have an example about a deprecated feature... |
A lot of maintaining a big project is not moving too fast and making sure Like doctors, first do no harm. On Sat, Jul 4, 2015 at 10:20 AM OceanWolf [email protected] wrote:
|
This PR deprecates
idle_event
and removes code related to it from the gtk backend.The reasoning for this is discussed in #4534, but briefly, idle_event functionality is broken or missing in all but the wx backends (and doesn't work very well there either) and code related to it causes spurious warning in the gtk backend (see #3769).
The animations module should be used instead of idle_event for animations.
Please let me know if there is anything else to add.