Skip to content

Commit b7f7ddd

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: lib/matplotlib/backends/qt4_editor/formlayout.py setupext.py
2 parents 1a3e9f1 + bb456e9 commit b7f7ddd

File tree

12 files changed

+151
-98
lines changed

12 files changed

+151
-98
lines changed

lib/matplotlib/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,21 @@ def compare_versions(a, b):
129129
raise ImportError(
130130
"matplotlib requires pyparsing >= 1.5.6")
131131

132-
if pyparsing.__version__ == '2.0.0':
133-
raise ImportError(
134-
"pyparsing 2.0.0 has bugs that prevent its use with "
135-
"matplotlib")
132+
# pyparsing 2.0.0 bug, but it may be patched in distributions
133+
try:
134+
f = pyparsing.Forward()
135+
f <<= pyparsing.Literal('a')
136+
bad_pyparsing = f is None
137+
except:
138+
bad_pyparsing = True
136139

137140
# pyparsing 1.5.6 does not have <<= on the Forward class, but
138141
# pyparsing 2.0.0 and later will spew deprecation warnings if
139142
# using << instead. Additionally, the <<= in pyparsing 1.5.7 is
140143
# broken, since it doesn't return self. In order to support
141144
# pyparsing 1.5.6 and above with a common code base, this small
142145
# monkey patch is applied.
143-
if not compare_versions(pyparsing.__version__, '2.0.1'):
146+
if bad_pyparsing:
144147
def _forward_ilshift(self, other):
145148
self.__lshift__(other)
146149
return self

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,8 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
32503250
edgecolors = kwargs.get('edgecolors', None)
32513251
if faceted is not None:
32523252
cbook.warn_deprecated(
3253-
'1.2', 'faceted', alternative='edgecolor', obj_type='option')
3253+
'1.2', name='faceted', alternative='edgecolor',
3254+
obj_type='option')
32543255
if faceted:
32553256
edgecolors = None
32563257
else:
@@ -4507,7 +4508,8 @@ def pcolor(self, *args, **kwargs):
45074508
vmax = kwargs.pop('vmax', None)
45084509
if 'shading' in kwargs:
45094510
cbook.warn_deprecated(
4510-
'1.2', 'shading', alternative='edgecolors', obj_type='option')
4511+
'1.2', name='shading', alternative='edgecolors',
4512+
obj_type='option')
45114513
shading = kwargs.pop('shading', 'flat')
45124514

45134515
X, Y, C = self._pcolorargs('pcolor', *args, allmatch=False)

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
15501550

15511551
if not len(facecolors):
15521552
filled = False
1553+
can_do_optimization = not gc.get_hatch()
15531554
else:
15541555
if np.all(facecolors[:, 3] == facecolors[0, 3]):
15551556
filled = facecolors[0, 3] != 0.0

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def set_color(self, color):
9292

9393
color = QtCore.Property("QColor", get_color, set_color)
9494

95+
def col2hex(color):
96+
"""Convert matplotlib color to hex before passing to Qt"""
97+
return rgb2hex(colorConverter.to_rgb(color))
9598

9699
def to_qcolor(color):
97100
"""Create a QColor from a matplotlib color"""

lib/matplotlib/cbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def new_function():
120120
The object type being deprecated.
121121
"""
122122
message = _generate_deprecation_message(
123-
since, message, name, alternative, pending, 'function')
123+
since, message, name, alternative, pending, obj_type)
124124

125125
warnings.warn(message, mplDeprecation, stacklevel=1)
126126

lib/matplotlib/mpl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import warnings
77
from matplotlib import cbook
88
cbook.warn_deprecated(
9-
'1.3', 'matplotlib.mpl', alternative='`import matplotlib as mpl`',
9+
'1.3', name='matplotlib.mpl', alternative='`import matplotlib as mpl`',
1010
obj_type='module')
1111
from matplotlib import artist
1212
from matplotlib import axis

lib/matplotlib/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup():
1414
# The baseline images are created in this locale, so we should use
1515
# it during all of the tests.
1616
import locale
17-
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
17+
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
1818

1919
use('Agg', warn=False) # use Agg backend for these tests
2020

Binary file not shown.
Loading

0 commit comments

Comments
 (0)