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 657f647

Browse filesBrowse files
committed
import new deprecation class as mplDeprecation
1 parent 394b1aa commit 657f647
Copy full SHA for 657f647

File tree

Expand file treeCollapse file tree

11 files changed

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

11 files changed

+52
-52
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
+18-18Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import matplotlib.ticker as mticker
3838
import matplotlib.transforms as mtransforms
3939
import matplotlib.tri as mtri
40-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
40+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
4141
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
4242

4343
iterable = cbook.iterable
@@ -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):
@@ -3135,13 +3135,13 @@ def connect(self, s, func):
31353135
disconnect to disconnect from the axes event
31363136
31373137
"""
3138-
raise mDeprecation('use the callbacks CallbackRegistry instance '
3139-
'instead')
3138+
raise mplDeprecation('use the callbacks CallbackRegistry instance '
3139+
'instead')
31403140

31413141
def disconnect(self, cid):
31423142
"""disconnect from the Axes event."""
3143-
raise mDeprecation('use the callbacks CallbackRegistry instance '
3144-
'instead')
3143+
raise mplDeprecation('use the callbacks CallbackRegistry instance '
3144+
'instead')
31453145

31463146
def get_children(self):
31473147
"""return a list of child artists"""
@@ -3192,8 +3192,8 @@ def pick(self, *args):
31923192
the artist and the artist has picker set
31933193
"""
31943194
if len(args) > 1:
3195-
raise mDeprecation('New pick API implemented -- '
3196-
'see API_CHANGES in the src distribution')
3195+
raise mplDeprecation('New pick API implemented -- '
3196+
'see API_CHANGES in the src distribution')
31973197
martist.Artist.pick(self, args[0])
31983198

31993199
### Labelling
@@ -3691,9 +3691,9 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
36913691
.. plot:: mpl_examples/pylab_examples/hline_demo.py
36923692
"""
36933693
if kwargs.get('fmt') is not None:
3694-
raise mDeprecation('hlines now uses a '
3695-
'collections.LineCollection and not a '
3696-
'list of Line2D to draw; see API_CHANGES')
3694+
raise mplDeprecation('hlines now uses a '
3695+
'collections.LineCollection and not a '
3696+
'list of Line2D to draw; see API_CHANGES')
36973697

36983698
# We do the conversion first since not all unitized data is uniform
36993699
# process the unit information
@@ -3773,9 +3773,9 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
37733773
"""
37743774

37753775
if kwargs.get('fmt') is not None:
3776-
raise mDeprecation('vlines now uses a '
3777-
'collections.LineCollection and not a '
3778-
'list of Line2D to draw; see API_CHANGES')
3776+
raise mplDeprecation('vlines now uses a '
3777+
'collections.LineCollection and not a '
3778+
'list of Line2D to draw; see API_CHANGES')
37793779

37803780
self._process_unit_info(xdata=x, ydata=[ymin, ymax], kwargs=kwargs)
37813781

@@ -6074,7 +6074,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
60746074
edgecolors = 'none'
60756075
warnings.warn(
60766076
'''replace "faceted=False" with "edgecolors='none'"''',
6077-
mDeprecation) # 2008/04/18
6077+
mplDeprecation) # 2008/04/18
60786078

60796079
# to be API compatible
60806080
if marker is None and not (verts is None):
@@ -8002,7 +8002,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
80028002
"orientation kwarg %s is not recognized" % orientation)
80038003

80048004
if kwargs.get('width') is not None:
8005-
raise mDeprecation(
8005+
raise mplDeprecation(
80068006
'hist now uses the rwidth to give relative width '
80078007
'and not absolute width')
80088008

@@ -8735,7 +8735,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
87358735
"""
87368736
if precision is None:
87378737
precision = 0
8738-
warnings.warn("Use precision=0 instead of None", mDeprecation)
8738+
warnings.warn("Use precision=0 instead of None", mplDeprecation)
87398739
# 2008/10/03
87408740
if marker is None and markersize is None and hasattr(Z, 'tocoo'):
87418741
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
@@ -48,7 +48,7 @@
4848
import matplotlib.tight_bbox as tight_bbox
4949
import matplotlib.textpath as textpath
5050
from matplotlib.path import Path
51-
from matplotlib import MatplotlibDeprecationWarning as mDeprecation
51+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
5252

5353
try:
5454
from PIL import Image
@@ -2307,7 +2307,7 @@ def start_event_loop_default(self, timeout=0):
23072307
"""
23082308
str = "Using default event loop until function specific"
23092309
str += " to this GUI is implemented"
2310-
warnings.warn(str, mDeprecation)
2310+
warnings.warn(str, mplDeprecation)
23112311

23122312
if timeout <= 0:
23132313
timeout = np.inf

‎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
@@ -789,7 +789,7 @@ def Printer_Init(self):
789789
790790
Deprecated.
791791
"""
792-
warnings.warn("Printer* methods will be removed", mDeprecation)
792+
warnings.warn("Printer* methods will be removed", mplDeprecation)
793793
self.printerData = wx.PrintData()
794794
self.printerData.SetPaperId(wx.PAPER_LETTER)
795795
self.printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
@@ -803,7 +803,7 @@ def Printer_Init(self):
803803

804804
def _get_printerData(self):
805805
if self._printerData is None:
806-
warnings.warn("Printer* methods will be removed", mDeprecation)
806+
warnings.warn("Printer* methods will be removed", mplDeprecation)
807807
self._printerData = wx.PrintData()
808808
self._printerData.SetPaperId(wx.PAPER_LETTER)
809809
self._printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
@@ -812,7 +812,7 @@ def _get_printerData(self):
812812

813813
def _get_printerPageData(self):
814814
if self._printerPageData is None:
815-
warnings.warn("Printer* methods will be removed", mDeprecation)
815+
warnings.warn("Printer* methods will be removed", mplDeprecation)
816816
self._printerPageData= wx.PageSetupDialogData()
817817
self._printerPageData.SetMarginBottomRight((25,25))
818818
self._printerPageData.SetMarginTopLeft((25,25))
@@ -831,7 +831,7 @@ def Printer_Setup(self, event=None):
831831
dmsg = """Width of output figure in inches.
832832
The current aspect ratio will be kept."""
833833

834-
warnings.warn("Printer* methods will be removed", mDeprecation)
834+
warnings.warn("Printer* methods will be removed", mplDeprecation)
835835
dlg = wx.Dialog(self, -1, 'Page Setup for Printing' , (-1,-1))
836836
df = dlg.GetFont()
837837
df.SetWeight(wx.NORMAL)
@@ -894,7 +894,7 @@ def Printer_Setup2(self, event=None):
894894
Deprecated.
895895
"""
896896

897-
warnings.warn("Printer* methods will be removed", mDeprecation)
897+
warnings.warn("Printer* methods will be removed", mplDeprecation)
898898
if hasattr(self, 'printerData'):
899899
data = wx.PageSetupDialogData()
900900
data.SetPrintData(self.printerData)
@@ -918,7 +918,7 @@ def Printer_Preview(self, event=None):
918918
919919
Deprecated.
920920
"""
921-
warnings.warn("Printer* methods will be removed", mDeprecation)
921+
warnings.warn("Printer* methods will be removed", mplDeprecation)
922922
po1 = PrintoutWx(self, width=self.printer_width,
923923
margin=self.printer_margin)
924924
po2 = PrintoutWx(self, width=self.printer_width,
@@ -944,7 +944,7 @@ def Printer_Print(self, event=None):
944944
945945
Deprecated.
946946
"""
947-
warnings.warn("Printer* methods will be removed", mDeprecation)
947+
warnings.warn("Printer* methods will be removed", mplDeprecation)
948948
pdd = wx.PrintDialogData()
949949
# SetPrintData for 2.4 combatibility
950950
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
@@ -1275,7 +1275,7 @@ def __init__(self, xy, radius=5, **kwargs):
12751275
import warnings
12761276
warnings.warn('Circle is now scale free. '
12771277
'Use CirclePolygon instead!',
1278-
mDeprecation)
1278+
mplDeprecation)
12791279
kwargs.pop('resolution')
12801280

12811281
self.radius = radius

0 commit comments

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