From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 1 Sep 2019 00:00:32 +0200 Subject: Initial import --- .../matplotlib-1.4.3-backport-GH5291-2462.patch | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch (limited to 'dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch') diff --git a/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch b/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch new file mode 100644 index 0000000..d6b2ae8 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch @@ -0,0 +1,126 @@ +commit f98c4846dc3c15b3d24aafb973764cb9b860d935 +Author: Thomas A Caswell +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']) -- cgit v1.2.3