Skip to content
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

Merged
merged 1 commit into from Nov 15, 2012

Conversation

ianthomas23
Copy link
Member

Class matplotlib.tri.Triangulation was not in the sphinx documentation. This PR adds a page to the API documentation containing the class.

@dmcdougall
Copy link
Member

+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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot.

@pelson
Copy link
Member

pelson commented Nov 14, 2012

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
Copy link
Member Author

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.

@dmcdougall
Copy link
Member

@ianthomas23 Do you consider this good to go?

@ianthomas23
Copy link
Member Author

@dmcdougall: Yes, it is good to go.

@pelson
Copy link
Member

pelson commented Nov 15, 2012

👍 from me.

dmcdougall added a commit that referenced this pull request Nov 15, 2012
Added sphinx documentation for Triangulation
@dmcdougall dmcdougall merged commit 39b5c7b into matplotlib:master Nov 15, 2012
@ianthomas23 ianthomas23 deleted the sphinx_triangulation branch July 8, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants