8000 Remove duplicate transform import from its tests. · matplotlib/matplotlib@246ab0e · GitHub
[go: up one dir, main page]

Skip to content

Commit 246ab0e

Browse files
committed
Remove duplicate transform import from its tests.
1 parent 91c117e commit 246ab0e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

lib/matplotlib/tests/test_transforms.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111
assert_array_equal, assert_array_almost_equal)
1212
import pytest
1313

14-
from matplotlib.transforms import (Affine2D, BlendedGenericTransform, Bbox,
15-
TransformedPath, TransformedPatchPath)
14+
import matplotlib.pyplot as plt
15+
import matplotlib.patches as mpatches
16+
import matplotlib.transforms as mtrans
1617
from matplotlib.path import Path
1718
from matplotlib.scale import LogScale
1819
from matplotlib.testing.decorators import cleanup, image_comparison
1920

20-
import matplotlib.transforms as mtrans
21-
import matplotlib.pyplot as plt
22-
import matplotlib.patches as mpatches
23-
2421

2522
@cleanup
2623
def test_non_affine_caching():
@@ -199,8 +196,8 @@ def test_clipping_of_log():
199196
path = Path(points, codes)
200197

201198
# something like this happens in plotting logarithmic histograms
202-
trans = BlendedGenericTransform(Affine2D(),
203-
LogScale.Log10Transform('clip'))
199+
trans = mtrans.BlendedGenericTransform(mtrans.Affine2D(),
200+
LogScale.Log10Transform('clip'))
204201
tpath = trans.transform_path_non_affine(path)
205202
result = tpath.iter_segments(trans.get_affine(),
206203
clip=(0, 0, 100, 100),
@@ -518,8 +515,8 @@ def test_log_transform():
518515

519516
@cleanup
520517
def test_nan_overlap():
521-
a = Bbox([[0, 0], [1, 1]])
522-
b = Bbox([[0, 0], [1, np.nan]])
518+
a = mtrans.Bbox([[0, 0], [1, 1]])
519+
b = mtrans.Bbox([[0, 0], [1, np.nan]])
523520
assert not a.overlaps(b)
524521

525522

@@ -577,7 +574,7 @@ def test_transformed_path():
577574
path = Path(points, codes)
578575

579576
trans = mtrans.Affine2D()
580-
trans_path = TransformedPath(path, trans)
577+
trans_path = mtrans.TransformedPath(path, trans)
581578
assert_allclose(trans_path.get_fully_transformed_path().vertices, points)
582579

583580
# Changing the transform should change the result.
@@ -598,7 +595,7 @@ def test_transformed_patch_path():
598595
trans = mtrans.Affine2D()
599596
patch = mpatches.Wedge((0, 0), 1, 45, 135, transform=trans)
600597

601-
tpatch = TransformedPatchPath(patch)
598+
tpatch = mtrans.TransformedPatchPath(patch)
602599
points = tpatch.get_fully_transformed_path().vertices
603600

604601
# Changing the transform should change the result.

0 commit comments

Comments
 (0)
0