Add IndirectTransform with tests (clean PR)#31379
Add IndirectTransform with tests (clean PR)#31379roshandhiman wants to merge 0 commit intomatplotlib:mainfrom
Conversation
You might want to check the "files changed" list on GitHub... |
|
⏰ This pull request might be automatically closed in two weeks from now. Thank you for your contribution to Matplotlib and for the effort you have put into this PR. This pull request does not yet meet the quality and clarity standards needed for an effective review. Project maintainers have limited time for code reviews, and our goal is to prioritize well-prepared contributions to keep Matplotlib maintainable. Matplotlib maintainers cannot provide one-to-one guidance on this PR. However, if you ask focused, well-researched questions, a community member may be willing to help. 💬 To increase the chance of a productive review:
As the author, you are responsible for driving this PR, which entails doing necessary background research as well as presenting its context and your thought process. If you are a new contributor, or do not know how to fulfill these requirements, we recommend that you familiarize yourself with Matplotlib's development conventions or engage with the community via our Discourse or one of our meetings before submitting code. If you substantially improve this PR within two weeks, leave a comment and a team member may remove the |
|
Please undo all the formatting changes that were applied to files you are not touching in this specific PR. Thanks |
d160de6 to
de9f36b
Compare
de9f36b to
e57fe4c
Compare
PR summary
This PR introduces a new
IndirectTransformclass that allows applying forward and inverse transformations using user-defined functions.Why is this change necessary?
Currently, there is no simple utility in
matplotlib.transformsto represent transformations defined purely by callable functions. This addition provides a lightweight and flexible abstraction for such use cases.What problem does it solve?
It enables users to define transformations without needing to subclass existing transform classes, making it easier to experiment with custom transformation logic.
What is the reasoning for this implementation?
The implementation keeps the interface minimal by accepting forward and inverse callables and integrating with the existing transform API.
Changes made
IndirectTransformimplementation inlib/matplotlib/transforms.pylib/matplotlib/tests/test_transforms.pyMinimal example