8000 Slightly tighten the Bbox/Transform API. by anntzer · Pull Request #13110 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Slightly tighten the Bbox/Transform API. #13110

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Jan 5, 2019

At least it's explicit that Bbox.inverse_transformed() follows the
Bbox.transformed() semantics, not those of Transform.transform_bbox() or
of TransformedBbox (#12059) (sounds obvious, but you never know...).

Also one less thing to implement for a possible future C implementation of the transform stack.

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

@anntzer anntzer force-pushed the inverse_transformed branch from c8a178a to 306feb8 Compare January 5, 2019 18:29
@efiring
Copy link
Member
efiring commented Jan 17, 2019

This is deprecating what was probably put in as a convenience function, but I see the logic of removing it. The tradeoff is that if the function is widely used, removing it is imposing a burden on users for a very small gain.

@anntzer
Copy link
Contributor Author
anntzer commented Jan 17, 2019

I argued in #12059 that the transform API is complex and inconsistent, and would benefit from some tightening.

@jklymak
Copy link
Member
jklymak commented Oct 1, 2019

I'm not following the rationale behind removing this helper....

@anntzer
Copy link
Contributor Author
anntzer commented Oct 1, 2019

Do you know the difference between TransformedBbox, Transform.transform_bbox, and Bbox.transformed? They all do slightly different things (#12059), and I think it's too bad that this is not more obvious from the names of the APIs; in other words there are too many ways to "apply" a transform to a bbox, and I'm trying to start removing some of those.

@anntzer anntzer force-pushed the inverse_transformed branch from b186809 to e4f7356 Compare October 1, 2019 17:11
@jklymak
Copy link
Member
jklymak commented Oct 1, 2019

Agreed its a bit of a mess and cleanup would be great. Do you have a roadmap? Maybe make a "project" so the rest of us can help/comment/not do contradictory things?

In the meantime though, this still seems like a useful helper 😉

@anntzer
Copy link
Contributor Author
anntzer commented Oct 1, 2019

It's basically discussed in #12059 -- still in progress.

I would argue that bbox.transformed(trf.inverted()) is not much more onerous to type than bbox.inverse_transformed(trf) (just two more characters), so let's just be explicit...

@timhoffm
Copy link
Member
timhoffm commented Oct 2, 2019

Unfortunately, needs rebase again due to the broken imports.

@anntzer anntzer force-pushed the inverse_transformed branch from e4f7356 to d739646 Compare October 2, 2019 23:26
@anntzer
Copy link
Contributor Author
anntzer commented Oct 2, 2019

rebased

@tacaswell tacaswell added this to the v3.3.0 milestone Oct 3, 2019
@anntzer anntzer force-pushed the inverse_transformed branch from d739646 to db9df82 Compare October 3, 2019 08:54
@efiring
Copy link
Member
efiring commented Mar 31, 2020

As a first step in simplifying the baffling transform API, I would like to see this go in.

8000

At least it's explicit that Bbox.inverse_transformed() follows the
Bbox.transformed() semantics, not those of Transform.transform_bbox() or
of TransformedBbox (sounds obvious, but you never know...).
@anntzer
Copy link
Contributor Author
anntzer commented Mar 31, 2020

rebased

@anntzer anntzer force-pushed the inverse_transformed branch from db9df82 to 39c9ac9 Compare March 31, 2020 07:41
@QuLogic QuLogic merged commit b9dfc53 into matplotlib:master Mar 31, 2020
@anntzer anntzer deleted the inverse_transformed branch March 31, 2020 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0