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
Added sphinx documentation for Triangulation #1494
Added sphinx documentation for Triangulation #1494
Conversation
+1 |
@@ -37,27 +37,6 @@ class Triangulation(object): | |||
triangles[i,(j+1)%3]. | |||
""" | |||
def __init__(self, x, y, triangles=None, mask=None): | |||
""" | |||
Create a Triangulation object. |
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 seems quite a useful docstring? Is it out of date?
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.
No, it is still valid. I discovered that sphinx chains together the class and constructor docstrings under the constructor heading. If they are sufficiently different we get away with it (as in the Path class at http://matplotlib.org/api/path_api.html - the constructor docstring begins after the Note), but in this case everything in the constructor docstring is already in the class docstring causing unnecessarily duplication. I thought the best solution was to remove the constructor docstring.
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.
Good spot.
I noticed this the other day too - thanks @ianthomas23 ! |
Return the underlying C++ Triangulation object, creating it | ||
if necessary. | ||
""" | ||
# Return the underlying C++ Triangulation object, creating it |
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.
Note I have changed this function's docstring to a comment as I don't want the function appearing in the sphinx documentation. The function should really be private with a leading underscore, but as this is a documentation PR I didn't want to change any code that would require new testing. I have made a note to address this when I am next altering the class.
@ianthomas23 Do you consider this good to go? |
@dmcdougall: Yes, it is good to go. |
👍 from me. |
Added sphinx documentation for Triangulation
Class matplotlib.tri.Triangulation was not in the sphinx documentation. This PR adds a page to the API documentation containing the class.