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

Skip to content

Commit 1b12e91

Browse files
committed
vectorize _comb with decorator syntax
1 parent e2a5dc1 commit 1b12e91

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/bezier.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
import matplotlib.cbook as cbook
1111

1212
# same algorithm as 3.8's math.comb
13+
@np.vectorize
1314
def _comb(n, k):
1415
k = min(k, n - k)
1516
i = np.arange(1, k + 1)
1617
return np.prod((n + 1 - i)/i).astype(int)
17-
_comb = np.vectorize(_comb)
18+
1819

1920
class NonIntersectingPathException(ValueError):
2021
pass
@@ -220,6 +221,7 @@ def find_bezier_t_intersecting_with_closedpath(
220221
start = middle
221222
start_inside = middle_inside
222223

224+
223225
class BezierSegment:
224226
"""
225227
A d-dimensional Bezier segment.

0 commit comments

Comments
 (0)