FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Some doc cleanup of Triangulation by timhoffm · Pull Request #11585 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
33 changes: 20 additions & 13 deletions lib/matplotlib/tri/triangulation.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,23 @@ class Triangulation(object):

Parameters
----------
x, y : array_like of shape (npoints)
x, y : array-like of shape (npoints)
Coordinates of grid points.
triangles : integer array_like of shape (ntri, 3), optional
For each triangle, the indices of the three points that make
up the triangle, ordered in an anticlockwise manner. If not
specified, the Delaunay triangulation is calculated.
mask : boolean array_like of shape (ntri), optional
mask : boolean array-like of shape (ntri), optional
Which triangles are masked out.

Attributes
----------
`edges`
`neighbors`
edges : int array of shape (nedges, 2)
See `~.Triangulation.edges`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This line is throwing an error for me when building the docs locally.

d:\...\matplotlib\lib\matplotlib\tri\triangulation.py:docstring of matplotlib.tri.Triangulation:40: toctree references unknown document 'api/matplotlib.tri.Triangulation.edges'

I wonder anyways why

   edges : int array of shape (nedges, 2)
        See `~.Triangulation.edges`

translates into

see link to built doc

Is there some novel doc interpolation going on? Does this have any additional requirement?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can not reproduce this locally.

Can you check for stale build products? What version of Matplotlib do you have installed (as the docs are built against the installed version).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The built documentation seems to be pulled from the docstring on the edges property below. The issues maybe different versions of numpydoc behaving differently...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good catch, thanks for the hint. I update the requirement in #11667

neighbors : int array of shape (ntri, 3)
See `~.Triangulation.neighbors`
mask : bool array of shape (ntri, 3)
Masked out triangles.
is_delaunay : bool
Whether the Triangulation is a calculated Delaunay
triangulation (where `triangles` was not specified) or not.
Expand Down Expand Up @@ -76,29 +80,32 @@ def __init__(self, x, y, triangles=None, mask=None):
def calculate_plane_coefficients(self, z):
"""
Calculate plane equation coefficients for all unmasked triangles from
the point (x,y) coordinates and specified z-array of shape (npoints).
Returned array has shape (npoints,3) and allows z-value at (x,y)
the point (x, y) coordinates and specified z-array of shape (npoints).
The returned array has shape (npoints, 3) and allows z-value at (x, y)
position in triangle tri to be calculated using
z = array[tri,0]*x + array[tri,1]*y + array[tri,2].
``z = array[tri, 0] * x + array[tri, 1] * y + array[tri, 2]``.
"""
return self.get_cpp_triangulation().calculate_plane_coefficients(z)

@property
def edges(self):
"""
Return integer array of shape (nedges,2) containing all edges of
Return integer array of shape (nedges, 2) containing all edges of
non-masked triangles.

Each edge is the start point index and end point index. Each
edge (start,end and end,start) appears only once.
Each row defines an edge by it's start point index and end point
index. Each edge appears only once, i.e. for an edge between points
*i* and *j*, there will only be either *(i, j)* or *(j, i)*.
"""
if self._edges is None:
self._edges = self.get_cpp_triangulation().get_edges()
return self._edges

def get_cpp_triangulation(self):
# Return the underlying C++ Triangulation object, creating it
# if necessary.
"""
Return the underlying C++ Triangulation object, creating it
if necessary.
"""
if self._cpp_triangulation is None:
self._cpp_triangulation = _tri.Triangulation(
self.x, self.y, self.triangles, self.mask, self._edges,
Expand Down Expand Up @@ -175,7 +182,7 @@ def get_trifinder(self):
@property
def neighbors(self):
"""
Return integer array of shape (ntri,3) containing neighbor
Return integer array of shape (ntri, 3) containing neighbor
triangles.

For each triangle, the indices of the three triangles that
Expand Down

Back | FazBrowse Home | New Git URL