Title: Tell IPython the correct GUI event loop to use for all backends. by anntzer · Pull Request #12637 · matplotlib/matplotlib · GitHub
Open Graph Title: Tell IPython the correct GUI event loop to use for all backends. by anntzer · Pull Request #12637 · matplotlib/matplotlib
X Title: Tell IPython the correct GUI event loop to use for all backends. by anntzer · Pull Request #12637 · matplotlib/matplotlib
Description: IPython currently uses a hard-coded table (IPython.core.pylabtools.backend2gui) to know which event loop to use for which backend. This approach fails for both the new builtin cairo-based backends (which do not appear in the table), and for third-party backends (e.g. mplcairo). mplcairo has used some custom code to patch that table for a while; reuse it to more generally use the new "required_interactive_framework" attribute. Note that this PR suggests that there should be a better way to go back from the canvas class to the backend module (rather than looking for sys.modules[cls.__module__].required_interactive_framework, which is a bit hacky and could in theory fail if the canvas class is actually defined in another submodule). (Edits: Actually the "hack" above "sort-of" fails for Qt4 in the sense that backend_qt4agg.FigureCanvas is actually the same class as backend_qt5agg.FigureCanvas, so trying to reach the required_interactive_framework that way will point to "qt5". But fortunately ipython maps both "qt4" and "qt5" to "qt", so we're fine... Perhaps we can just mandate that the __module__ attribute of FigureCanvas subclasses must point to their actual backend module name. It's not as if requiring that the backend module name be stored in another attribute really helps.) Fixes #10763. attn @Carreau PR Summary PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: IPython currently uses a hard-coded table (IPython.core.pylabtools.backend2gui) to know which event loop to use for which backend. This approach fails for both the new builtin cairo-based backends...
X Description: IPython currently uses a hard-coded table (IPython.core.pylabtools.backend2gui) to know which event loop to use for which backend. This approach fails for both the new builtin cairo-based backends...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/12637
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3d97eb7e-9393-08df-6b79-60b613ee3251 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8710:3C8974:E61932:1376AA2:6A570846 |
| html-safe-nonce | db3643578a025282ca61105bac352fc377dea8bac46994745117b21a6c02172f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzEwOjNDODk3NDpFNjE5MzI6MTM3NkFBMjo2QTU3MDg0NiIsInZpc2l0b3JfaWQiOiI0NTUzMzM3NjM1MzY0ODY2MTE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 708af9b3e70f75ee5c198f8ba536e2a7fd0fa1d281b5c507815113551b4db0e6 |
| hovercard-subject-tag | pull_request:226032100 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/12637/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | IPython currently uses a hard-coded table (IPython.core.pylabtools.backend2gui) to know which event loop to use for which backend. This approach fails for both the new builtin cairo-based backends... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb29e5f807bd95e41196adfbc6d28f9af12d89830d8b684f3e871774ddff2fc |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b056788a129fb0194b61f2ebb4c43f6a9f4dfd27 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width