Title: Shorten various offsetbox implementations by anntzer · Pull Request #21699 · matplotlib/matplotlib · GitHub
Open Graph Title: Shorten various offsetbox implementations by anntzer · Pull Request #21699 · matplotlib/matplotlib
X Title: Shorten various offsetbox implementations by anntzer · Pull Request #21699 · matplotlib/matplotlib
Description: PR Summary 1st commit: Inherit OffsetBox.{get_offset,get_window_extent}. By making the parameters of OffsetBox.get_offset optional (which matches the fact that there are currently subclasses for which get_offset does not take any parameters), and adjusting OffsetBox.get_window_extent to use get_extent (which is typically redefined in subclasses) instead of get_extent_offsets (which is not), we can inherit the implementation of OffsetBox.get_window_extent across most subclasses instead of having to copy-paste it again and again. 2nd commit: Inline AnchoredOffsetBox._update_offset_func. It is only called in get_window_extent -- and in draw, but that call is immediately followed by a call to get_window_extent, so it is redundant. PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. 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). Documentation is sphinx and numpydoc compliant (the docs should build without error).
Open Graph Description: PR Summary 1st commit: Inherit OffsetBox.{get_offset,get_window_extent}. By making the parameters of OffsetBox.get_offset optional (which matches the fact that there are currently subclasses for wh...
X Description: PR Summary 1st commit: Inherit OffsetBox.{get_offset,get_window_extent}. By making the parameters of OffsetBox.get_offset optional (which matches the fact that there are currently subclasses for wh...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/21699
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7cfcb7b2-a90d-4cf3-62e0-ecdd8b17620f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CCE8:256E35:11B17D0:19330E3:6A552380 |
| html-safe-nonce | 0b1350c147442481cc43059e2ce5cabed5ff400c8552caed38c17372e6430bb9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0U4OjI1NkUzNToxMUIxN0QwOjE5MzMwRTM6NkE1NTIzODAiLCJ2aXNpdG9yX2lkIjoiMjk1MzQxNDkzOTgyMDQ5OTg0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a9f66128c714482008f16f6552fa5b1be7dd56f70bcd2a2e30b5141d729cf4c |
| hovercard-subject-tag | pull_request:785391392 |
| 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/21699/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 | PR Summary 1st commit: Inherit OffsetBox.{get_offset,get_window_extent}. By making the parameters of OffsetBox.get_offset optional (which matches the fact that there are currently subclasses for wh... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| 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 | 358dd24ad7465d20e3fae729b5b169d35b0dd7f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width