Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commiteb0bbfa

Browse files
committed
Remove mplDeprecation which is just an alias to MatplotlibDeprecationWarning
1 parent0f05cf4 commiteb0bbfa

File tree

8 files changed

+19
-10
lines changed

8 files changed

+19
-10
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
``matplotlib.cbook.deprecation.mplDeprecation`` is deprecated
2+
-------------------------------------------------------------
3+
4+
:class:`matplotlib.cbook.deprecation.mplDeprecation` will be removed in
5+
future versions. It is just an alias for
6+
:class:`matplotlib.cbook.deprecation.MatplotlibDeprecationWarning`.
7+
Please use the:class:`~.MatplotlibDeprecationWarning` directly if neccessary.

‎lib/matplotlib/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
# definitions, so it is safe to import from it here.
141141
from .importcbook
142142
frommatplotlib.cbookimport (
143-
mplDeprecation,dedent,get_label,sanitize_sequence)
143+
MatplotlibDeprecationWarning,dedent,get_label,sanitize_sequence)
144+
frommatplotlib.cbookimportmplDeprecation# deprecated
144145
frommatplotlib.rcsetupimportdefaultParams,validate_backend,cycler
145146

146147
importnumpy
@@ -1092,7 +1093,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
10921093

10931094
iter_params=defaultParams.items()
10941095
withwarnings.catch_warnings():
1095-
warnings.simplefilter("ignore",mplDeprecation)
1096+
warnings.simplefilter("ignore",MatplotlibDeprecationWarning)
10961097
config=RcParams([(key,default)forkey, (default,_)initer_params
10971098
ifkeynotin_all_deprecated])
10981099
config.update(config_from_file)
@@ -1133,7 +1134,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
11331134
rcParamsOrig=rcParams.copy()
11341135

11351136
withwarnings.catch_warnings():
1136-
warnings.simplefilter("ignore",mplDeprecation)
1137+
warnings.simplefilter("ignore",MatplotlibDeprecationWarning)
11371138
rcParamsDefault=RcParams([(key,default)forkey, (default,converter)in
11381139
defaultParams.items()
11391140
ifkeynotin_all_deprecated])

‎lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
importmatplotlib.transformsasmtransforms
3535
importmatplotlib.triasmtri
3636
frommatplotlib.cbookimport (
37-
mplDeprecation,warn_deprecated,STEP_LOOKUP_MAP,iterable,
37+
MatplotlibDeprecationWarning,warn_deprecated,STEP_LOOKUP_MAP,iterable,
3838
safe_first_element)
3939
frommatplotlib.containerimportBarContainer,ErrorbarContainer,StemContainer
4040
frommatplotlib.axes._baseimport_AxesBase,_process_plot_format

‎lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
importnumpyasnp
3232

3333
importmatplotlib
34-
from .deprecationimportdeprecated,warn_deprecated
35-
from .deprecationimportmplDeprecation,MatplotlibDeprecationWarning
34+
from .deprecationimport(
35+
mplDeprecation,deprecated,warn_deprecated,MatplotlibDeprecationWarning)
3636

3737

3838
@deprecated("3.0")

‎lib/matplotlib/cbook/deprecation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class MatplotlibDeprecationWarning(UserWarning):
1717

1818

1919
mplDeprecation=MatplotlibDeprecationWarning
20+
"""mplDeprecation is deprecated. Use MatplotlibDeprecationWarning instead."""
2021

2122

2223
def_generate_deprecation_message(

‎lib/matplotlib/gridspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
importnumpyasnp
2121

2222
importmatplotlibasmpl
23-
frommatplotlibimport_pylab_helpers,tight_layout,rcParams
23+
frommatplotlibimport_pylab_helpers,cbook,tight_layout,rcParams
2424
frommatplotlib.transformsimportBbox
2525
importmatplotlib._layoutboxaslayoutbox
2626

‎lib/matplotlib/pyplot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
frommatplotlibimport_pylab_helpers,interactive
3434
frommatplotlib.cbookimport (
3535
dedent,deprecated,silent_list,warn_deprecated,_string_to_bool)
36+
frommatplotlib.cbookimportmplDeprecation# deprecated
3637
frommatplotlibimportdocstring
3738
frommatplotlib.backend_basesimportFigureCanvasBase
3839
frommatplotlib.figureimportFigure,figaspect
@@ -2276,9 +2277,9 @@ def plotfile(fname, cols=(0,), plotfuncs=None,
22762277

22772278
ifplotfuncsisNone:
22782279
plotfuncs=dict()
2279-
frommatplotlib.cbookimportmplDeprecation
2280+
frommatplotlib.cbookimportMatplotlibDeprecationWarning
22802281
withwarnings.catch_warnings():
2281-
warnings.simplefilter('ignore',mplDeprecation)
2282+
warnings.simplefilter('ignore',MatplotlibDeprecationWarning)
22822283
r=mlab.csv2rec(fname,comments=comments,skiprows=skiprows,
22832284
checkrows=checkrows,delimiter=delimiter,names=names)
22842285

‎lib/matplotlib/tests/test_cycles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
importwarnings
22

33
frommatplotlib.testing.decoratorsimportimage_comparison
4-
frommatplotlib.cbookimportMatplotlibDeprecationWarning
54
importmatplotlib.pyplotasplt
65
importnumpyasnp
76
importpytest

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp