-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Cleanup GridHelperCurveLinear/GridFinder. #25729
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -234,18 +234,27 @@ def __init__(self, aux_trans, | |||||||||||||||||||||||||||||
tick_formatter1=None, | ||||||||||||||||||||||||||||||
tick_formatter2=None): | ||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||
aux_trans : a transform from the source (curved) coordinate to | ||||||||||||||||||||||||||||||
target (rectilinear) coordinate. An instance of MPL's Transform | ||||||||||||||||||||||||||||||
(inverse transform should be defined) or a tuple of two callable | ||||||||||||||||||||||||||||||
objects which defines the transform and its inverse. The callables | ||||||||||||||||||||||||||||||
need take two arguments of array of source coordinates and | ||||||||||||||||||||||||||||||
should return two target coordinates. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
e.g., ``x2, y2 = trans(x1, y1)`` | ||||||||||||||||||||||||||||||
Parameters | ||||||||||||||||||||||||||||||
---------- | ||||||||||||||||||||||||||||||
aux_trans : `.Transform` or tuple[Callable, Callable] | ||||||||||||||||||||||||||||||
The transform from curved coordinates to rectilinear coordinate: | ||||||||||||||||||||||||||||||
either a `.Transform` instance (which provides also its inverse), | ||||||||||||||||||||||||||||||
or a pair of callables ``(trans, inv_trans)`` that define the | ||||||||||||||||||||||||||||||
transform and its inverse. The callables should have signature:: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
x_rect, y_rect = trans(x_curved, y_curved) | ||||||||||||||||||||||||||||||
x_curved, y_curved = inv_trans(x_rect, y_rect) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
extreme_finder | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
grid_locator1, grid_locator2 | ||||||||||||||||||||||||||||||
Grid locators for each axis. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
tick_formatter1, tick_formatter2 | ||||||||||||||||||||||||||||||
Tick formatters for each axis. | ||||||||||||||||||||||||||||||
Comment on lines
+248
to
+254
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not sure which class extreme_finder is. Bonus for proper links... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They're not really locators and formatters though (but rather axisartist's variants on them). |
||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||
super().__init__() | ||||||||||||||||||||||||||||||
self._grid_info = None | ||||||||||||||||||||||||||||||
self._aux_trans = aux_trans | ||||||||||||||||||||||||||||||
self.grid_finder = GridFinder(aux_trans, | ||||||||||||||||||||||||||||||
extreme_finder, | ||||||||||||||||||||||||||||||
grid_locator1, | ||||||||||||||||||||||||||||||
|
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.
Modify this to
aux_trans
for consistency (as this is the internal one, probably makes more sense to modify it here)?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 don't really want to bother going through a separate deprecation of the parameter name if we're going to fully inline GridFinder anyways. Plus, aux_trans is a pretty awkward name, if anything I actually prefer transform.