-
-
Notifications
You must be signed in to change notification settings - Fork 8k
MNT/DOC: Deprecate anchor in Axes3D.set_aspect #30408
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
base: main
Are you sure you want to change the base?
MNT/DOC: Deprecate anchor in Axes3D.set_aspect #30408
Conversation
4e0dfa6
to
5088f5d
Compare
5088f5d
to
8f0e5ec
Compare
Hello |
@@ -244,7 +244,7 @@ def _transformed_cube(self, vals): | |||
(minx, maxy, maxz)] | |||
return proj3d._proj_points(xyzs, self.M) | |||
|
|||
def set_aspect(self, aspect, adjustable=None, anchor=None, share=False): | |||
def set_aspect(self, aspect, adjustable=None, anchor=None): |
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.
Why did you delete share
?
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.
Hello! I removed the share parameter because it was only being passed to the super().set_aspect() call.
During local testing, I found that the super() call was causing an ImageComparisonFailure in the existing test_aspects test. Based on the original issue's suggestion and that test failure, I removed the super() call entirely. Since share was no longer being used anywhere inside the method, I removed it from the signature and docstring as well to clean up the unused code.
Please let me know if you think it should be handled differently
'SE' lower right corner | ||
etc. | ||
===== ===================== | ||
``adjustable`` : None or {'box', 'datalim'}, optional |
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.
Why is this code style now?
This parameter is not used for 3D axes but is present for | ||
compatibility with 2D axes. It will be ignored. |
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.
This doesn't seem to be what the title of the PR / the related issue suggests; is it true?
|
||
share : bool, default: False | ||
If ``True``, apply the settings to all shared Axes. | ||
``anchor`` : None or str or 2-tuple of float, optional |
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.
Why is this changed to code style?
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.
This should go in one of the existing files unless you definitely don't see one that matches, but it shouldn't have this name then.
If ``True``, apply the settings to all shared Axes. | ||
``anchor`` : None or str or 2-tuple of float, optional | ||
.. deprecated:: 3.11 | ||
The `anchor` parameter is not used for 3D axes and will be |
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.
You can't reference parameters.
The `anchor` parameter is not used for 3D axes and will be | |
The *anchor* parameter is not used for 3D axes and will be |
This PR closes #30364 .
PR summary
This PR cleans up the
Axes3D.set_aspect
method by deprecating the unusedanchor
parameter and clarifying the documentation for 3D-specific behavior.Why is this change necessary? The method inherited the
anchor
andadjustable
parameters from its 2D parent, but these are confusing and not applicable in a 3D context. This led to an inaccurate docstring.What problem does it solve? It removes a confusing, non-functional parameter from the API and provides users with clear, accurate documentation for how
set_aspect
behaves on 3D axes.What is the reasoning for this implementation?
anchor
is used, making the deprecation clear to users without breaking existing tests that rely on the defaultanchor=None
.super()
call has been removed to simplify the logic, resolving a visual inconsistency found during testing.adjustable
parameter and formally deprecateanchor
.A new unit test has been added to specifically verify the deprecation warning is raised correctly.
PR checklist
anchor
andadjustable
arguments #30364 " is in the body of the PR description to link the related issue