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 588b748

Browse filesBrowse files
authored
Merge pull request #6654 from tacaswell/mnt_points_contain_return_bool
FIX: cast return of `contains_points` to bool
2 parents 66eb81f + 4819a2c commit 588b748
Copy full SHA for 588b748

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+4
-3
lines changed

‎lib/matplotlib/path.py

Copy file name to clipboardExpand all lines: lib/matplotlib/path.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def contains_points(self, points, transform=None, radius=0.0):
510510
if transform is not None:
511511
transform = transform.frozen()
512512
result = _path.points_in_path(points, radius, self, transform)
513-
return result
513+
return result.astype('bool')
514514

515515
def contains_path(self, path, transform=None):
516516
"""

‎lib/matplotlib/tests/test_path.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_path.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ def test_point_in_path():
2828

2929
path = Path(verts2, closed=True)
3030
points = [(0.5, 0.5), (1.5, 0.5)]
31-
32-
assert np.all(path.contains_points(points) == [True, False])
31+
ret = path.contains_points(points)
32+
assert ret.dtype == 'bool'
33+
assert np.all(ret == [True, False])
3334

3435

3536
def test_contains_points_negative_radius():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.