Skip to content

Commit 01910b5

Browse files
committed
Move module cbook.deprecation to _api.deprecation
1 parent 9d93c2d commit 01910b5

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import matplotlib
3131
from matplotlib import _c_internal_utils
32-
from .deprecation import (
32+
from matplotlib._api.deprecation import (
3333
deprecated, warn_deprecated,
3434
_rename_parameter, _delete_parameter, _make_keyword_only,
3535
_deprecate_method_override, _deprecate_privatize_attribute,

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import matplotlib
3636
import matplotlib.colorbar
3737
import matplotlib.image
38+
from matplotlib import _api
3839
from matplotlib import rcsetup, style
3940
from matplotlib import _pylab_helpers, interactive
4041
from matplotlib import cbook
@@ -2986,7 +2987,7 @@ def quiverkey(Q, X, Y, U, label, **kw):
29862987
def scatter(
29872988
x, y, s=None, c=None, marker=None, cmap=None, norm=None,
29882989
vmin=None, vmax=None, alpha=None, linewidths=None,
2989-
verts=cbook.deprecation._deprecated_parameter,
2990+
verts=_api.deprecation._deprecated_parameter,
29902991
edgecolors=None, *, plotnonfinite=False, data=None, **kwargs):
29912992
__ret = gca().scatter(
29922993
x, y, s=s, c=c, marker=marker, cmap=cmap, norm=norm,

lib/matplotlib/tests/test_cbook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
assert_array_almost_equal)
1212
import pytest
1313

14+
from matplotlib import _api
1415
import matplotlib.cbook as cbook
1516
import matplotlib.colors as mcolors
1617
from matplotlib.cbook import MatplotlibDeprecationWarning, delete_masked_points
@@ -618,7 +619,7 @@ def func2(**kwargs):
618619
with pytest.warns(MatplotlibDeprecationWarning):
619620
func(foo="bar")
620621

621-
def pyplot_wrapper(foo=cbook.deprecation._deprecated_parameter):
622+
def pyplot_wrapper(foo=_api.deprecation._deprecated_parameter):
622623
func1(foo)
623624

624625
pyplot_wrapper() # No warning.

tools/boilerplate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# This line imports the installed copy of matplotlib, and not the local copy.
2424
import numpy as np
25-
from matplotlib import cbook, mlab
25+
from matplotlib import _api, mlab
2626
from matplotlib.axes import Axes
2727
from matplotlib.figure import Figure
2828

@@ -74,8 +74,8 @@ def __init__(self, value):
7474
self._repr = "mlab.window_hanning"
7575
elif value is np.mean:
7676
self._repr = "np.mean"
77-
elif value is cbook.deprecation._deprecated_parameter:
78-
self._repr = "cbook.deprecation._deprecated_parameter"
77+
elif value is _api.deprecation._deprecated_parameter:
78+
self._repr = "_api.deprecation._deprecated_parameter"
7979
elif isinstance(value, Enum):
8080
# Enum str is Class.Name whereas their repr is <Class.Name: value>.
8181
self._repr = str(value)

0 commit comments

Comments
 (0)