Skip to content

Commit ca69d46

Browse files
committed
vectorize _comb with decorator syntax
1 parent 489fb19 commit ca69d46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/bezier.py

+3-1
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)