Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ca69d46

Browse filesBrowse files
committed
vectorize _comb with decorator syntax
1 parent 489fb19 commit ca69d46
Copy full SHA for ca69d46

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/bezier.py

Copy file name to clipboardExpand all lines: lib/matplotlib/bezier.py
+3-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.