Title: Don't revalidate original rcParams when exiting rc_context. by anntzer · Pull Request #8962 · matplotlib/matplotlib · GitHub
Open Graph Title: Don't revalidate original rcParams when exiting rc_context. by anntzer · Pull Request #8962 · matplotlib/matplotlib
X Title: Don't revalidate original rcParams when exiting rc_context. by anntzer · Pull Request #8962 · matplotlib/matplotlib
Description: Rewrite rc_context using contextmanager, which removes the need for saving state. When __exit__ing rc_context, skip rcParam validation, as the items have already been validated originally. The rationale for not revalidating (beyond a minor gain in speed) is that it may make sense to smuggle seemingly "invalid" values into the rcParams (by calling dict.__setitem__), and we do not want them to cause an error when exiting a rc_context (of course, they may or may not cause an error at the backend level, but that is the responsibility of whoever set this "invalid" value). For example, the rcparam lines.antialiased is declared as a boolean, but the mpl_cairo backend actually also recognizes any of cairo's internal antialiasing enum values (NONE, FAST, GOOD, BEST, etc.). (The rst docs needed to be slightly updated because .. autoclass:: rc_context won't work anymore, so I also took advantage of that to reorder all the rc-related functions slightly more logically.) PR Summary PR Checklist Has Pytest style unit tests Code is PEP 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: Rewrite rc_context using contextmanager, which removes the need for saving state. When __exit__ing rc_context, skip rcParam validation, as the items have already been validated originally. The ...
X Description: Rewrite rc_context using contextmanager, which removes the need for saving state. When __exit__ing rc_context, skip rcParam validation, as the items have already been validated originally. The ...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/8962
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:388d59a7-e14e-1cb7-be6c-93a0611a18e1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B7D0:3C0E3A:1B0C734:23B4206:6A52CE85 |
| html-safe-nonce | 91f7d565f57c8e1ac22d95e8a3577b8b8c04ffaf77b96c2d0ceacc8986a1f814 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0QwOjNDMEUzQToxQjBDNzM0OjIzQjQyMDY6NkE1MkNFODUiLCJ2aXNpdG9yX2lkIjoiNzY0NzM2ODE1MzQwNDcyMjgyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 135d17739be33602bdd60f4e11b069b8002aedb6f82c2fe8eaca807716513b15 |
| hovercard-subject-tag | pull_request:133119317 |
| 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/8962/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 | Rewrite rc_context using contextmanager, which removes the need for saving state. When __exit__ing rc_context, skip rcParam validation, as the items have already been validated originally. The ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width