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

Skip to content

Commit 2c37ba1

Browse files
committed
Integer division in trirefine
1 parent 8993188 commit 2c37ba1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/matplotlib/colors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def is_color_like(c):
222222

223223
def rgb2hex(rgb):
224224
'Given an rgb or rgba sequence of 0-1 floats, return the hex string'
225-
return '#%02x%02x%02x' % tuple([int(np.round(val * 255)) for val in rgb[:3]])
225+
a = '#%02x%02x%02x' % tuple([int(np.round(val * 255)) for val in rgb[:3]])
226+
return a
226227

227228
hexColorPattern = re.compile("\A#[a-fA-F0-9]{6}\Z")
228229

lib/matplotlib/tri/trirefine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
231231
# points
232232
# hint: each apex is shared by 2 masked_triangles except the borders.
233233
borders = np.sum(neighbors == -1)
234-
added_pts = (3*ntri + borders) / 2
234+
added_pts = (3*ntri + borders) // 2
235235
refi_npts = npts + added_pts
236236
refi_x = np.zeros(refi_npts)
237237
refi_y = np.zeros(refi_npts)

0 commit comments

Comments
 (0)