-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
Import Events and Matplotlib Interactive Fixes #2225
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2225 +/- ##
==========================================
- Coverage 29.37% 29.25% -0.13%
==========================================
Files 95 95
Lines 15688 15709 +21
Branches 2926 2927 +1
==========================================
- Hits 4608 4595 -13
- Misses 10562 10594 +32
- Partials 518 520 +2
Continue to review full report at Codecov.
|
This seems absurdly dangerous. Are there other ways to accomplish this without new events? Or with events that are not so broad in scope and power? |
I don't know that this is any more or less dangerous than what Python's import system already provides. Anyone could write an import finder and stick it at the start of the |
@scopatz : I can't get this working: It just shows a blank figure. If I then run
|
Thanks for trying it out @melund. I think this is almost certainly a matplotlib & windows issue. I know that they have had issues like this open in the past (matplotlib/matplotlib#3052). Perhaps it is best to report this there? This PR does fix some of the issues I was seeing on Linux, though. Having dived into the matplotlib code to write this PR, I am not convinced that their interactive mode is really well thought out. They special case a lot of stuff to work for just IPython. It would be much better to have a real API to work with. |
Then I am OK with merging. |
Thanks @melund! I do think this is worth reporting over at matplotlib. They seem to be trying to move towards something better. Bringing it up again couldn't hurt. |
I agree. Also maybe a new issue for xonsh so we don't forget. I don't have time to do it right now thus. |
Sure, but let's close out the old bug and label the new one as a feature. |
Agreed
Den tir. 21. feb. 2017 05.47 skrev Anthony Scopatz <notifications@github.com
…:
Sure, but let's close out the old bug and label the new one as a feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2225 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA_agoj3FIOz7eoMdu8G_fIS5iPTiA7Nks5remxGgaJpZM4MFoIg>
.
|
This PR adds six new events for hooking into Python's import mechanism. Now you can register a handler for before/after a module is search for, created, or exec'd. There are probably some pretty crazy abuses of this.
The initial application of this is to help fix some of the interactivity issues with matplotlib. This should close out #1043. Some of the problems mentioned in that issue seemed to related to mpl v1.x and have since been fixed in mpl v2.x. This PR tries to address the remaining problems.