Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bad5f7

Browse files
committed
Merge pull request #2371 from ianthomas23/warn_deprecated_correction
Corrections to cbook.warn_deprecated calls().
2 parents 1fa7400 + ec486d7 commit 8bad5f7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/matplotlib/axes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6281,7 +6281,8 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
62816281
edgecolors = kwargs.get('edgecolors', None)
62826282
if faceted is not None:
62836283
cbook.warn_deprecated(
6284-
'1.2', 'faceted', alternative='edgecolor', obj_type='option')
6284+
'1.2', name='faceted', alternative='edgecolor',
6285+
obj_type='option')
62856286
if faceted:
62866287
edgecolors = None
62876288
else:
@@ -7537,7 +7538,8 @@ def pcolor(self, *args, **kwargs):
75377538
vmax = kwargs.pop('vmax', None)
75387539
if 'shading' in kwargs:
75397540
cbook.warn_deprecated(
7540-
'1.2', 'shading', alternative='edgecolors', obj_type='option')
7541+
'1.2', name='shading', alternative='edgecolors',
7542+
obj_type='option')
75417543
shading = kwargs.pop('shading', 'flat')
75427544

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

lib/matplotlib/cbook.py

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

122122
warnings.warn(message, mplDeprecation, stacklevel=1)
123123

lib/matplotlib/mpl.py

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

0 commit comments

Comments
 (0)