-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
More Axis3D cleanup. #14963
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
More Axis3D cleanup. #14963
Conversation
Deprecations | ||
```````````` | ||
|
||
``axis3d.get_flip_min_max`` is deprecated. |
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.
Doesn't this reference need an initial dot?
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.
Oh wait, that's just code style; why not the full path then?
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.
Added mplot3d in front; as a rule I tend to not put the leading "matplotlib" or "mpl_toolkits" (it's a bit repetitive otherwise).
It's code style because the link is about to be broken.
lib/mpl_toolkits/mplot3d/axis3d.py
Outdated
*centers* by *deltas*. | ||
""" | ||
coord = np.asarray(coord) | ||
return coord + axmask * np.sign(coord - centers) * deltas |
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 is not exactly the same, but I'm not sure if it's important, as if coord == centers
, then np.sign
will return 0 and no movement will be made at all.
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.
fair point, fortunately I can use copysign() to fix that.
- Use ndarray.copy instead of copy.copy. - "Inline" get_flip_min_max. - Vectorize move_from_center. - Pass 3-tuples as `*xyz` instead of `xyz[0], xyz[1], xyz[2]` to maintain them as "single" objects. - Convert `pep` to an array immediately. - Use more explicit way to count nonzero elements.
*xyz
instead ofxyz[0], xyz[1], xyz[2]
tomaintain them as "single" objects.
pep
to an array immediately.PR Summary
PR Checklist