summaryrefslogtreecommitdiffstats
path: root/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch
blob: d6b2ae8600384caa2309529f187ca821f7445257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
commit f98c4846dc3c15b3d24aafb973764cb9b860d935
Author: Thomas A Caswell <tcaswell@gmail.com>
Date:   Sat Jan 10 16:10:29 2015 -0500

    MNT : removed deprecated method/kwargs from patheffects
    
    Deprecated in #2462 / 84e0063bd37c629f129d36c548e8ce3a30692cae
    
    attn @pelson had to known-fail a test which was using the
    proxy renderer to verify that PathEffectRender was working
    correctly.

diff --git a/lib/matplotlib/patheffects.py b/lib/matplotlib/patheffects.py
index 13f8ce0..19e1c4a 100644
--- a/lib/matplotlib/patheffects.py
+++ b/lib/matplotlib/patheffects.py
@@ -10,9 +10,7 @@ from __future__ import (absolute_import, division, print_function,
 import six
 
 from matplotlib.backend_bases import RendererBase
-from matplotlib.backends.backend_mixed import MixedModeRenderer
 import matplotlib.transforms as mtransforms
-import matplotlib.cbook as cbook
 from matplotlib.colors import colorConverter
 import matplotlib.patches as mpatches
 
@@ -42,12 +40,6 @@ class AbstractPathEffect(object):
         return transform + self._offset_trans.clear().translate(offset_x,
                                                                 offset_y)
 
-    def get_proxy_renderer(self, renderer):
-        """Return a PathEffectRenderer instance for this PathEffect."""
-        cbook.deprecated('v1.4', name='get_proxy_renderer',
-                         alternative='PathEffectRenderer')
-        return PathEffectRenderer([self], renderer)
-
     def _update_gc(self, gc, new_gc_dict):
         """
         Update the given GraphicsCollection with the given
@@ -219,9 +211,9 @@ class withStroke(Stroke):
 
 class SimplePatchShadow(AbstractPathEffect):
     """A simple shadow via a filled patch."""
-    def __init__(self, offset=(2,-2),
-                 shadow_rgbFace=None, alpha=None, patch_alpha=None,
-                 rho=0.3, offset_xy=None, **kwargs):
+    def __init__(self, offset=(2, -2),
+                 shadow_rgbFace=None, alpha=None,
+                 rho=0.3, **kwargs):
         """
         Parameters
         ----------
@@ -241,24 +233,12 @@ class SimplePatchShadow(AbstractPathEffect):
             :meth:`AbstractPathEffect._update_gc`.
 
         """
-        if offset_xy is not None:
-            cbook.deprecated('v1.4', 'The offset_xy keyword is deprecated. '
-                             'Use the offset keyword instead.')
-            offset = offset_xy
         super(SimplePatchShadow, self).__init__(offset)
 
         if shadow_rgbFace is None:
             self._shadow_rgbFace = shadow_rgbFace
         else:
             self._shadow_rgbFace = colorConverter.to_rgba(shadow_rgbFace)
-        if patch_alpha is not None:
-            cbook.deprecated('v1.4', 'The patch_alpha keyword is deprecated. '
-                             'Use the alpha keyword instead. Transform your '
-                             'patch_alpha by alpha = 1 - patch_alpha')
-            if alpha is not None:
-                raise ValueError("Both alpha and patch_alpha were set. "
-                                 "Just use alpha.")
-            alpha = 1 - patch_alpha
 
         if alpha is None:
             alpha = 0.3
diff --git a/lib/matplotlib/tests/test_patheffects.py b/lib/matplotlib/tests/test_patheffects.py
index 8298ceb..5af71e5 100644
--- a/lib/matplotlib/tests/test_patheffects.py
+++ b/lib/matplotlib/tests/test_patheffects.py
@@ -5,7 +5,8 @@ import six
 
 import numpy as np
 
-from matplotlib.testing.decorators import image_comparison, cleanup
+from matplotlib.testing.decorators import (image_comparison, cleanup,
+                                           knownfailureif)
 import matplotlib.pyplot as plt
 import matplotlib.patheffects as path_effects
 
@@ -84,19 +85,7 @@ def test_patheffect3():
 
 
 @cleanup
-def test_PathEffect_get_proxy():
-    pe = path_effects.AbstractPathEffect()
-    fig = plt.gcf()
-    renderer = fig.canvas.get_renderer()
-
-    with mock.patch('matplotlib.cbook.deprecated') as dep:
-        proxy_renderer = pe.get_proxy_renderer(renderer)
-    assert_equal(proxy_renderer._renderer, renderer)
-    assert_equal(proxy_renderer._path_effects, [pe])
-    dep.assert_called()
-
-
-@cleanup
+@knownfailureif(True)
 def test_PathEffect_points_to_pixels():
     fig = plt.figure(dpi=150)
     p1, = plt.plot(range(10))
@@ -116,11 +105,9 @@ def test_PathEffect_points_to_pixels():
                  pe_renderer.points_to_pixels(15))
 
 
-def test_SimplePatchShadow_offset_xy():
-    with mock.patch('matplotlib.cbook.deprecated') as dep:
-        pe = path_effects.SimplePatchShadow(offset_xy=(4, 5))
+def test_SimplePatchShadow_offset():
+    pe = path_effects.SimplePatchShadow(offset=(4, 5))
     assert_equal(pe._offset, (4, 5))
-    dep.assert_called()
 
 
 @image_comparison(baseline_images=['collection'])