Skip to content

Commit d8a0175

Browse files
committed
Fix tests
1 parent 116588c commit d8a0175

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ def set_verts(self, verts, closed=True):
10981098
return
10991099

11001100
# Fast path for arrays
1101-
if isinstance(verts, np.ndarray):
1101+
if isinstance(verts, np.ndarray) and len(verts):
11021102
verts_pad = (np.concatenate((verts, verts[:, :1]), axis=1)
11031103
.astype(mpath.Path.verts_type))
11041104
# Creating the codes once is much faster than having Path do it

lib/matplotlib/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Path:
7676
"""
7777
__slots__ = ('_vertices', '_codes', '_readonly',
7878
'_should_simplify', '_simplify_threshold',
79-
'_interpolation_steps')
79+
'_interpolation_steps', '__weakref__')
8080

8181
code_type = np.uint8
8282
verts_type = float

lib/matplotlib/tests/test_transforms.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -621,28 +621,6 @@ def test_invalid_arguments():
621621
t.transform([[1, 2, 3]])
622622

623623

624-
def test_transformed_path():
625-
points = [(0, 0), (1, 0), (1, 1), (0, 1)]
626-
path = Path(points, closed=True)
627-
628-
trans = mtransforms.Affine2D()
629-
trans_path = mtransforms.TransformedPath(path, trans)
630-
assert_allclose(trans_path.get_fully_transformed_path().vertices, points)
631-
632-
# Changing the transform should change the result.
633-
r2 = 1 / np.sqrt(2)
634-
trans.rotate(np.pi / 4)
635-
assert_allclose(trans_path.get_fully_transformed_path().vertices,
636-
[(0, 0), (r2, r2), (0, 2 * r2), (-r2, r2)],
637-
atol=1e-15)
638-
639-
# Changing the path does not change the result (it's cached).
640-
path.points = [(0, 0)] * 4
641-
assert_allclose(trans_path.get_fully_transformed_path().vertices,
642-
[(0, 0), (r2, r2), (0, 2 * r2), (-r2, r2)],
643-
atol=1e-15)
644-
645-
646624
def test_transformed_patch_path():
647625
trans = mtransforms.Affine2D()
648626
patch = mpatches.Wedge((0, 0), 1, 45, 135, transform=trans)

0 commit comments

Comments
 (0)