Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
2a8b34b
to9364728
CompareUh oh!
There was an error while loading.Please reload this page.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst