-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
numpydoc-ify art3d docstrings #10400
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
Conversation
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.
For the most part, it looks good to me. Just a couple minor points of clarification.
lib/mpl_toolkits/mplot3d/art3d.py
Outdated
|
||
Returns | ||
------- | ||
np.array((x, y, z)) |
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.
slight quibble, if a tuple was passed in, then a tuple comes back. So array-like, instead?
*zdir* Direction of text | ||
|
||
Keyword arguments are passed onto :func:`~matplotlib.text.Text`. | ||
''' |
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.
Question: If a subclass puts a docstring up in the class level (as opposed to the __init__
level), but the parent class has a docstring in its __init__
, which one shows up in sphinx? I haven't checked if that is the case here, just wondering.
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 haven't checked either. Just following the numpydoc guide
The constructor (
__init__
) should also be documented here [class docstring], the Parameters section of the docstring details the constructors parameters.
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.
Just checked: Both, the class and the init docstring of the base class are replaced by the class docstring of the derived class. This is what we want in the present case, so it's ok.
lib/mpl_toolkits/mplot3d/art3d.py
Outdated
---------- | ||
zsort : bool or {'average', 'min', 'max'} | ||
For 'average', 'min', 'max' the z-order is determined by applying | ||
the function to the z-orders of the individual polygons. *True* is |
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.
"the function to the z coordinates of the vertices in the viewer's coordinate system."
Perhaps clearer, more precise. Z-order as a term is a bit loaded in matplotlib.
467fe58
to
34bb685
Compare
lib/mpl_toolkits/mplot3d/art3d.py
Outdated
''' | ||
Text object with 3D position and (in the future) direction. | ||
''' | ||
class Text3D(mtext.Taext): |
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 be mtext.Text
!
34bb685
to
491ac50
Compare
lib/mpl_toolkits/mplot3d/art3d.py
Outdated
Returns | ||
------- | ||
x, y, z : array-like | ||
The direction vector. This is either a numpy.array *zdir* itself if |
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.
... numpy.array or *zdir* itself ...
Other than the one little typo, this looks good to me. |
491ac50
to
110b2d7
Compare
110b2d7
to
13bf5e2
Compare
ping @WeatherGod @dstansby All requested changes are applied. Do I have to dismiss the reviews? |
PR Summary
Convert the art3d docstrings to numpydoc / PEP-8.