Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f07af9a

Browse files
committed
Removed unnecessary duplication of arrays.
1 parent d55d861 commit f07af9a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/delaunay/triangulate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ def __init__(self, x, y):
106106
self.j_unique = np.delete(np.arange(len(self.x)), duplicates)
107107
self.x = self.x[self.j_unique]
108108
self.y = self.y[self.j_unique]
109-
110-
# Create map of point indices used by delaunay to those used
111-
# by client.
112-
self._client_point_index_map = np.delete(np.arange(self.old_shape[0]),
113-
duplicates)
114109
else:
115110
self.j_unique = None
116-
self._client_point_index_map = None
111+
112+
# If there are duplicate points, need a map of point indices used
113+
# by delaunay to those used by client. If there are no duplicate
114+
# points then the map is not needed. Either way, the map is
115+
# conveniently the same as j_unique, so share it.
116+
self._client_point_index_map = self.j_unique
117117

118118
self.circumcenters, self.edge_db, self.triangle_nodes, \
119119
self.triangle_neighbors = delaunay(self.x, self.y)

0 commit comments

Comments
 (0)