Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 929d359

Browse filesBrowse files
committed
import new deprecation class as mplDeprecation
1 parent 10351b3 commit 929d359
Copy full SHA for 929d359

File tree

Expand file treeCollapse file tree

11 files changed

+53
-53
lines changed
Filter options
Expand file treeCollapse file tree

11 files changed

+53
-53
lines changed

‎CHANGELOG

Copy file name to clipboardExpand all lines: CHANGELOG
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
2012-12-05 Added MatplotlibDeprecationWarning class for signaling deprecation.
22
Matplotlib developers can use this class as follows:
33

4-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
4+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
55

66
In light of the fact that Python builtin DeprecationWarnings are
77
ignored by default as of Python 2.7, this class was put in to allow

‎lib/matplotlib/axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes.py
+19-19Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import matplotlib.ticker as mticker
3737
import matplotlib.transforms as mtransforms
3838
import matplotlib.tri as mtri
39-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
39+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
4040
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
4141

4242
iterable = cbook.iterable
@@ -151,7 +151,7 @@ def set_default_color_cycle(clist):
151151
152152
"""
153153
rcParams['axes.color_cycle'] = clist
154-
warnings.warn("Set rcParams['axes.color_cycle'] directly", mDeprecation)
154+
warnings.warn("Set rcParams['axes.color_cycle'] directly", mplDeprecation)
155155

156156

157157
class _process_plot_var_args(object):
@@ -1376,11 +1376,11 @@ def get_child_artists(self):
13761376
13771377
.. deprecated:: 0.98
13781378
"""
1379-
raise mDeprecation('Use get_children instead')
1379+
raise mplDeprecation('Use get_children instead')
13801380

13811381
def get_frame(self):
13821382
"""Return the axes Rectangle frame"""
1383-
warnings.warn('use ax.patch instead', mDeprecation)
1383+
warnings.warn('use ax.patch instead', mplDeprecation)
13841384
return self.patch
13851385

13861386
def get_legend(self):
@@ -3112,13 +3112,13 @@ def connect(self, s, func):
31123112
disconnect to disconnect from the axes event
31133113
31143114
"""
3115-
raise mDeprecation('use the callbacks CallbackRegistry instance '
3116-
'instead')
3115+
raise mplDeprecation('use the callbacks CallbackRegistry instance '
3116+
'instead')
31173117

31183118
def disconnect(self, cid):
31193119
"""disconnect from the Axes event."""
3120-
raise mDeprecation('use the callbacks CallbackRegistry instance '
3121-
'instead')
3120+
raise mplDeprecation('use the callbacks CallbackRegistry instance '
3121+
'instead')
31223122

31233123
def get_children(self):
31243124
"""return a list of child artists"""
@@ -3168,8 +3168,8 @@ def pick(self, *args):
31683168
the artist and the artist has picker set
31693169
"""
31703170
if len(args) > 1:
3171-
raise mDeprecation('New pick API implemented -- '
3172-
'see API_CHANGES in the src distribution')
3171+
raise mplDeprecation('New pick API implemented -- '
3172+
'see API_CHANGES in the src distribution')
31733173
martist.Artist.pick(self, args[0])
31743174

31753175
def __pick(self, x, y, trans=None, among=None):
@@ -3730,9 +3730,9 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
37303730
.. plot:: mpl_examples/pylab_examples/hline_demo.py
37313731
"""
37323732
if kwargs.get('fmt') is not None:
3733-
raise mDeprecation('hlines now uses a '
3734-
'collections.LineCollection and not a '
3735-
'list of Line2D to draw; see API_CHANGES')
3733+
raise mplDeprecation('hlines now uses a '
3734+
'collections.LineCollection and not a '
3735+
'list of Line2D to draw; see API_CHANGES')
37363736

37373737
# We do the conversion first since not all unitized data is uniform
37383738
# process the unit information
@@ -3810,9 +3810,9 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
38103810
"""
38113811

38123812
if kwargs.get('fmt') is not None:
3813-
raise mDeprecation('vlines now uses a '
3814-
'collections.LineCollection and not a '
3815-
'list of Line2D to draw; see API_CHANGES')
3813+
raise mplDeprecation('vlines now uses a '
3814+
'collections.LineCollection and not a '
3815+
'list of Line2D to draw; see API_CHANGES')
38163816

38173817
self._process_unit_info(xdata=x, ydata=[ymin, ymax], kwargs=kwargs)
38183818

@@ -6086,7 +6086,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
60866086
edgecolors = 'none'
60876087
warnings.warn(
60886088
'''replace "faceted=False" with "edgecolors='none'"''',
6089-
mDeprecation) # 2008/04/18
6089+
mplDeprecation) # 2008/04/18
60906090

60916091
sym = None
60926092
symstyle = 0
@@ -7999,7 +7999,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
79997999

80008000

80018001
if kwargs.get('width') is not None:
8002-
raise mDeprecation(
8002+
raise mplDeprecation(
80038003
'hist now uses the rwidth to give relative width '
80048004
'and not absolute width')
80058005

@@ -8715,7 +8715,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
87158715
"""
87168716
if precision is None:
87178717
precision = 0
8718-
warnings.warn("Use precision=0 instead of None", mDeprecation)
8718+
warnings.warn("Use precision=0 instead of None", mplDeprecation)
87198719
# 2008/10/03
87208720
if marker is None and markersize is None and hasattr(Z, 'tocoo'):
87218721
marker = 's'

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import matplotlib.tight_bbox as tight_bbox
4747
import matplotlib.textpath as textpath
4848
from matplotlib.path import Path
49-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
49+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
5050

5151
try:
5252
from PIL import Image
@@ -2275,7 +2275,7 @@ def start_event_loop_default(self,timeout=0):
22752275
"""
22762276
str = "Using default event loop until function specific"
22772277
str += " to this GUI is implemented"
2278-
warnings.warn(str, mDeprecation)
2278+
warnings.warn(str, mplDeprecation)
22792279

22802280
if timeout <= 0: timeout = np.inf
22812281
timestep = 0.01

‎lib/matplotlib/backends/backend_qt.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import sys
55
import warnings
66

7-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
7+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
88

99
warnings.warn("QT3-based backends are deprecated and will be removed after"
1010
" the v1.2.x release. Use the equivalent QT4 backend instead.",
11-
mDeprecation)
11+
mplDeprecation)
1212

1313
import matplotlib
1414
from matplotlib import verbose

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import numpy as np
2727

28-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
28+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
2929

3030
# Debugging settings here...
3131
# Debug level set here. If the debug level is less than 5, information
@@ -793,7 +793,7 @@ def Printer_Init(self):
793793
794794
Deprecated.
795795
"""
796-
warnings.warn("Printer* methods will be removed", mDeprecation)
796+
warnings.warn("Printer* methods will be removed", mplDeprecation)
797797
self.printerData = wx.PrintData()
798798
self.printerData.SetPaperId(wx.PAPER_LETTER)
799799
self.printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
@@ -807,7 +807,7 @@ def Printer_Init(self):
807807

808808
def _get_printerData(self):
809809
if self._printerData is None:
810-
warnings.warn("Printer* methods will be removed", mDeprecation)
810+
warnings.warn("Printer* methods will be removed", mplDeprecation)
811811
self._printerData = wx.PrintData()
812812
self._printerData.SetPaperId(wx.PAPER_LETTER)
813813
self._printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
@@ -816,7 +816,7 @@ def _get_printerData(self):
816816

817817
def _get_printerPageData(self):
818818
if self._printerPageData is None:
819-
warnings.warn("Printer* methods will be removed", mDeprecation)
819+
warnings.warn("Printer* methods will be removed", mplDeprecation)
820820
self._printerPageData= wx.PageSetupDialogData()
821821
self._printerPageData.SetMarginBottomRight((25,25))
822822
self._printerPageData.SetMarginTopLeft((25,25))
@@ -835,7 +835,7 @@ def Printer_Setup(self, event=None):
835835
dmsg = """Width of output figure in inches.
836836
The current aspect ratio will be kept."""
837837

838-
warnings.warn("Printer* methods will be removed", mDeprecation)
838+
warnings.warn("Printer* methods will be removed", mplDeprecation)
839839
dlg = wx.Dialog(self, -1, 'Page Setup for Printing' , (-1,-1))
840840
df = dlg.GetFont()
841841
df.SetWeight(wx.NORMAL)
@@ -898,7 +898,7 @@ def Printer_Setup2(self, event=None):
898898
Deprecated.
899899
"""
900900

901-
warnings.warn("Printer* methods will be removed", mDeprecation)
901+
warnings.warn("Printer* methods will be removed", mplDeprecation)
902902
if hasattr(self, 'printerData'):
903903
data = wx.PageSetupDialogData()
904904
data.SetPrintData(self.printerData)
@@ -922,7 +922,7 @@ def Printer_Preview(self, event=None):
922922
923923
Deprecated.
924924
"""
925-
warnings.warn("Printer* methods will be removed", mDeprecation)
925+
warnings.warn("Printer* methods will be removed", mplDeprecation)
926926
po1 = PrintoutWx(self, width=self.printer_width,
927927
margin=self.printer_margin)
928928
po2 = PrintoutWx(self, width=self.printer_width,
@@ -948,7 +948,7 @@ def Printer_Print(self, event=None):
948948
949949
Deprecated.
950950
"""
951-
warnings.warn("Printer* methods will be removed", mDeprecation)
951+
warnings.warn("Printer* methods will be removed", mplDeprecation)
952952
pdd = wx.PrintDialogData()
953953
# SetPrintData for 2.4 combatibility
954954
pdd.SetPrintData(self.printerData)

‎lib/matplotlib/cbook.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from weakref import ref, WeakKeyDictionary
2323

2424
import matplotlib
25-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
25+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
2626

2727
import numpy as np
2828
import numpy.ma as ma
@@ -282,7 +282,7 @@ def __init__(self, *args):
282282
warnings.warn(
283283
'CallbackRegistry no longer requires a list of callback types.'
284284
' Ignoring arguments',
285-
mDeprecation)
285+
mplDeprecation)
286286
self.callbacks = dict()
287287
self._cid = 0
288288
self._func_cid_map = {}
@@ -1677,7 +1677,7 @@ def less_simple_linear_interpolation(x, y, xi, extrap=False):
16771677
# deprecated from cbook in 0.98.4
16781678
warnings.warn('less_simple_linear_interpolation has been moved to '
16791679
'matplotlib.mlab -- please import it from there',
1680-
mDeprecation)
1680+
mplDeprecation)
16811681
import matplotlib.mlab as mlab
16821682
return mlab.less_simple_linear_interpolation(x, y, xi, extrap=extrap)
16831683

@@ -1689,7 +1689,7 @@ def vector_lengths(X, P=2.0, axis=None):
16891689
"""
16901690
# deprecated from cbook in 0.98.4
16911691
warnings.warn('vector_lengths has been moved to matplotlib.mlab -- '
1692-
'please import it from there', mDeprecation)
1692+
'please import it from there', mplDeprecation)
16931693
import matplotlib.mlab as mlab
16941694
return mlab.vector_lengths(X, P=2.0, axis=axis)
16951695

@@ -1701,7 +1701,7 @@ def distances_along_curve(X):
17011701
"""
17021702
# deprecated from cbook in 0.98.4
17031703
warnings.warn('distances_along_curve has been moved to matplotlib.mlab '
1704-
'-- please import it from there', mDeprecation)
1704+
'-- please import it from there', mplDeprecation)
17051705
import matplotlib.mlab as mlab
17061706
return mlab.distances_along_curve(X)
17071707

@@ -1713,7 +1713,7 @@ def path_length(X):
17131713
"""
17141714
# deprecated from cbook in 0.98.4
17151715
warnings.warn('path_length has been moved to matplotlib.mlab '
1716-
'-- please import it from there', mDeprecation)
1716+
'-- please import it from there', mplDeprecation)
17171717
import matplotlib.mlab as mlab
17181718
return mlab.path_length(X)
17191719

@@ -1725,7 +1725,7 @@ def is_closed_polygon(X):
17251725
"""
17261726
# deprecated from cbook in 0.98.4
17271727
warnings.warn('is_closed_polygon has been moved to matplotlib.mlab '
1728-
'-- please import it from there', mDeprecation)
1728+
'-- please import it from there', mplDeprecation)
17291729
import matplotlib.mlab as mlab
17301730
return mlab.is_closed_polygon(X)
17311731

@@ -1737,7 +1737,7 @@ def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y):
17371737
"""
17381738
# deprecated from cbook in 0.98.4
17391739
warnings.warn('quad2cubic has been moved to matplotlib.mlab -- please '
1740-
'import it from there', mDeprecation)
1740+
'import it from there', mplDeprecation)
17411741
import matplotlib.mlab as mlab
17421742
return mlab.quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y)
17431743

‎lib/matplotlib/legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from matplotlib.offsetbox import DraggableOffsetBox
3232

3333
from matplotlib.container import ErrorbarContainer, BarContainer, StemContainer
34-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
34+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
3535
import legend_handler
3636

3737

@@ -279,7 +279,7 @@ def __init__(self, parent, handles, labels,
279279
# counter part is None.
280280
if localdict[k] is not None and localdict[v] is None:
281281
warnings.warn("Use '%s' instead of '%s'." % (v, k),
282-
mDeprecation)
282+
mplDeprecation)
283283
setattr(self, v, localdict[k] * axessize_fontsize)
284284
continue
285285

‎lib/matplotlib/mlab.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mlab.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
import numpy as np
149149
ma = np.ma
150150
from matplotlib import verbose
151-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
151+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
152152

153153
import matplotlib.cbook as cbook
154154
from matplotlib import docstring
@@ -1209,7 +1209,7 @@ def liaupunov(x, fprime):
12091209
"""
12101210

12111211
warnings.warn("This does not belong in matplotlib and will be removed",
1212-
mDeprecation) # 2009/06/13
1212+
mplDeprecation) # 2009/06/13
12131213

12141214
return np.mean(np.log(np.absolute(fprime(x))))
12151215

@@ -1341,7 +1341,7 @@ def save(fname, X, fmt='%.18e',delimiter=' '):
13411341
for comma-separated values.
13421342
"""
13431343

1344-
warnings.warn("use numpy.savetxt", mDeprecation) # 2009/06/13
1344+
warnings.warn("use numpy.savetxt", mplDeprecation) # 2009/06/13
13451345

13461346
if cbook.is_string_like(fname):
13471347
if fname.endswith('.gz'):
@@ -1428,7 +1428,7 @@ def load(fname,comments='#',delimiter=None, converters=None,skiprows=0,
14281428
Exercises many of these options.
14291429
"""
14301430

1431-
warnings.warn("use numpy.loadtxt", mDeprecation) # 2009/06/13
1431+
warnings.warn("use numpy.loadtxt", mplDeprecation) # 2009/06/13
14321432

14331433
if converters is None: converters = {}
14341434
fh = cbook.to_filehandle(fname)

‎lib/matplotlib/nxutils.py

Copy file name to clipboardExpand all lines: lib/matplotlib/nxutils.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warnings
22

33
from matplotlib import path
4-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
4+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
55

66
def pnpoly(x, y, xyverts):
77
"""
@@ -20,7 +20,7 @@ def pnpoly(x, y, xyverts):
2020
warnings.warn(
2121
"nxutils is deprecated. Use matplotlib.path.Path.contains_point"
2222
" instead.",
23-
mDeprecation)
23+
mplDeprecation)
2424

2525
p = path.Path(xyverts)
2626
return p.contains_point(x, y)
@@ -45,7 +45,7 @@ def points_inside_poly(xypoints, xyverts):
4545
warnings.warn(
4646
"nxutils is deprecated. Use matplotlib.path.Path.contains_points"
4747
" instead.",
48-
mDeprecation)
48+
mplDeprecation)
4949

5050
p = path.Path(xyverts)
5151
return p.contains_points(xypoints)

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from matplotlib import docstring
1313
import matplotlib.transforms as transforms
1414
from matplotlib.path import Path
15-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
15+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
1616

1717
# these are not available for the object inspector until after the
1818
# class is built so we define an initial set here for the init
@@ -1269,7 +1269,7 @@ def __init__(self, xy, radius=5, **kwargs):
12691269
import warnings
12701270
warnings.warn('Circle is now scale free. '
12711271
'Use CirclePolygon instead!',
1272-
mDeprecation)
1272+
mplDeprecation)
12731273
kwargs.pop('resolution')
12741274

12751275
self.radius = radius

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.