Skip to content

Commit d462a47

Browse files
authored
Merge pull request #16899 from QuLogic/trianalyzer-returns
Remove optional returns from TriAnalyzer._get_compressed_triangulation.
2 parents ce9c860 + 34109d7 commit d462a47

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

lib/matplotlib/tri/triinterpolate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def __init__(self, triangulation, z, kind='min_E', trifinder=None,
398398
# (used) node numbering.
399399
tri_analyzer = TriAnalyzer(self._triangulation)
400400
(compressed_triangles, compressed_x, compressed_y, tri_renum,
401-
node_renum) = tri_analyzer._get_compressed_triangulation(True, True)
401+
node_renum) = tri_analyzer._get_compressed_triangulation()
402402
self._triangles = compressed_triangles
403403
self._tri_renum = tri_renum
404404
# Taking into account the node renumbering in self._z:

lib/matplotlib/tri/tritools.py

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -190,26 +190,14 @@ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
190190

191191
return np.ma.filled(current_mask, True)
192192

193-
def _get_compressed_triangulation(self, return_tri_renum=False,
194-
return_node_renum=False):
193+
def _get_compressed_triangulation(self):
195194
"""
196195
Compress (if masked) the encapsulated triangulation.
197196
198197
Returns minimal-length triangles array (*compressed_triangles*) and
199198
coordinates arrays (*compressed_x*, *compressed_y*) that can still
200199
describe the unmasked triangles of the encapsulated triangulation.
201200
202-
Parameters
203-
----------
204-
return_tri_renum : bool, default: False
205-
Indicates whether a renumbering table to translate the triangle
206-
numbers from the encapsulated triangulation numbering into the
207-
new (compressed) renumbering will be returned.
208-
return_node_renum : bool, default: False
209-
Indicates whether a renumbering table to translate the nodes
210-
numbers from the encapsulated triangulation numbering into the
211-
new (compressed) renumbering will be returned.
212-
213201
Returns
214202
-------
215203
compressed_triangles : array-like
@@ -222,12 +210,11 @@ def _get_compressed_triangulation(self, return_tri_renum=False,
222210
renumbering table to translate the triangle numbers from the
223211
encapsulated triangulation into the new (compressed) renumbering.
224212
-1 for masked triangles (deleted from *compressed_triangles*).
225-
Returned only if *return_tri_renum* is True.
226213
node_renum : int array
227214
renumbering table to translate the point numbers from the
228215
encapsulated triangulation into the new (compressed) renumbering.
229216
-1 for unused points (i.e. those deleted from *compressed_x* and
230-
*compressed_y*). Returned only if *return_node_renum* is True.
217+
*compressed_y*).
231218
232219
"""
233220
# Valid triangles and renumbering
@@ -246,20 +233,8 @@ def _get_compressed_triangulation(self, return_tri_renum=False,
246233
# Now renumbering the valid triangles nodes
247234
compressed_triangles = node_renum[compressed_triangles]
248235

249-
# 4 cases possible for return
250-
if not return_tri_renum:
251-
if not return_node_renum:
252-
return compressed_triangles, compressed_x, compressed_y
253-
else:
254-
return (compressed_triangles, compressed_x, compressed_y,
255-
node_renum)
256-
else:
257-
if not return_node_renum:
258-
return (compressed_triangles, compressed_x, compressed_y,
259-
tri_renum)
260-
else:
261-
return (compressed_triangles, compressed_x, compressed_y,
262-
tri_renum, node_renum)
236+
return (compressed_triangles, compressed_x, compressed_y, tri_renum,
237+
node_renum)
263238

264239
@staticmethod
265240
def _total_to_compress_renum(mask, n=None):

0 commit comments

Comments
 (0)