-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Clean up get_proj() docstring (used view_init docstring as reference) #16996
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.
Thanks for looking into this.
Actually, I'm wondering why elev, azim and dist are mentioned here. They are only remotely related to the method.
Hi, thanks for the comment. I am not sure either; it almost seems like it was mistakenly copied over from the |
That's better than the current gibberish. 😄 Even better would be to describe the projection matrix. IMHO it's not self-explanatory How does it look? How is it used? But I don't insist on that extension. |
Thank you for your input! I can take a better look later this month; here's the docstring with just the method description for now. |
lib/mpl_toolkits/mplot3d/axes3d.py
Outdated
@@ -946,11 +946,7 @@ def set_proj_type(self, proj_type): | ||
def get_proj(self): | ||
""" | ||
Create the projection matrix from the current viewing position. |
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.
If the docstring is just a single line, we use the more compact notation:
def _get_proj(self):
"""Create the projection matrix from the current viewing position."""
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.
Thank you for your patience. I updated the docstring to follow the specified notation; I also updated another method's one line docstring in the same file which wasn't following the notation. There is a docstrings I am not sure about, as it seems incomplete:
def _3d_extend_contour(self, cset, stride=5):
"""
Extend a contour in 3D by creating
"""
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.
Indeed that does seem to trail off mid-sentence. You can either push more commits to this PR to try and finish the sentence or do that in a second PR.
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 can have a look at it later and open a second PR 😄
lib/mpl_toolkits/mplot3d/axes3d.py
Outdated
Look for unit *kwargs* and update the axis instances as necessary | ||
|
||
""" | ||
"""Look for unit *kwargs* and update the axis instances as necessary.""" |
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 exceeds the line limit of 79 chars and thus flake8 complains. One option would be less wordy:
"""Update the axis instances based on unit *kwargs* if given."""
OTOH it would be even better to document the 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.
Thank you for pointing that out! I changed the docstring so that it does not exceed the line limit as you advised. In the following days I will make another PR to expand on the doc for _3d_extend_contour
and for _process_unit_info
so that the parameters are documented.
Thanks, and congratulations on your first contribution to Matplotlib! We hope to see you back some time. |
PR Summary
Clean up the get_proj() docstring so that it follows the same format as view_init(elev=None, azim=None).
PR Checklist