Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reparametrize offsetbox calculations in terms of bboxes.#24465

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ksunden merged 1 commit intomatplotlib:mainfromanntzer:ob
Dec 23, 2022

Conversation

anntzer
Copy link
Contributor

Passing a single bbox instead of (xdescent, ydescent, width, height) separately is easier to follow (see e.g. the changes in VPacker and HPacker, which no longer have to repeatedly pack/unpack whd_list), and avoids having to figure out e.g. the sign of the descents and whether width/height includes the descents, for example.

Currently get_offset keeps a backcompatible signature (wecould consider killing the old signature but let's not do that for now), and _get_bbox_and_child_offsets is private because Imay want to later also change the convention to make offsets relative to the bbox (0, 0) point rather than the bbox lower-left corner.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

Passing a single bbox instead of (xdescent, ydescent, width, height)separately is easier to follow (see e.g. the changes in VPacker andHPacker, which no longer have to repeatedly pack/unpack whd_list), andavoids having to figure out e.g. the sign of the descents and whetherwidth/height includes the descents, for example.Currently get_offset keeps a back compatible signature (we *could*consider killing the old signature but let's not do that for now), and_get_bbox_and_child_offsets is private because I *may* want to lateralso change the convention to make offsets relative to the bbox (0, 0)point rather than the bbox lower-left corner.

@functools.wraps(meth)
def get_offset(self, *args, **kwargs):
params = _api.select_matching_signature(sigs, self, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should probably warn if the old signature is used,select_matching_signature does not do so itself.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I intentionally chose not to deprecate anything yet as I think we can live at least with one release supporting both apis to make sure the new one makes sense?

@ksundenksunden merged commitb4474c4 intomatplotlib:mainDec 23, 2022
@anntzeranntzer deleted the ob branchDecember 23, 2022 20:43
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@oscargusoscargusoscargus left review comments

@tacaswelltacaswelltacaswell approved these changes

@ksundenksundenksunden approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.7.0
Development

Successfully merging this pull request may close these issues.

4 participants
@anntzer@tacaswell@ksunden@oscargus

[8]ページ先頭

©2009-2025 Movatter.jp