104
104
105
105
# cbook must import matplotlib only within function
106
106
# definitions, so it is safe to import from it here.
107
- from . import cbook , docstring , rcsetup
107
+ from . import _api , cbook , docstring , rcsetup
108
108
from matplotlib .cbook import MatplotlibDeprecationWarning , sanitize_sequence
109
109
from matplotlib .cbook import mplDeprecation # deprecated
110
110
from matplotlib .rcsetup import validate_backend , cycler
@@ -670,7 +670,7 @@ def __getitem__(self, key):
670
670
def __repr__ (self ):
671
671
class_name = self .__class__ .__name__
672
672
indent = len (class_name ) + 1
673
- with cbook . _suppress_matplotlib_deprecation_warning ():
673
+ with _api . suppress_matplotlib_deprecation_warning ():
674
674
repr_split = pprint .pformat (dict (self ), indent = 1 ,
675
675
width = 80 - indent ).split ('\n ' )
676
676
repr_indented = ('\n ' + ' ' * indent ).join (repr_split )
@@ -681,7 +681,7 @@ def __str__(self):
681
681
682
682
def __iter__ (self ):
683
683
"""Yield sorted list of keys."""
684
- with cbook . _suppress_matplotlib_deprecation_warning ():
684
+ with _api . suppress_matplotlib_deprecation_warning ():
685
685
yield from sorted (dict .__iter__ (self ))
686
686
687
687
def __len__ (self ):
@@ -845,10 +845,10 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
845
845
if not use_default_template :
846
846
return config_from_file
847
847
848
- with cbook . _suppress_matplotlib_deprecation_warning ():
848
+ with _api . suppress_matplotlib_deprecation_warning ():
849
849
config = RcParams ({** rcParamsDefault , ** config_from_file })
850
850
851
- with cbook . _suppress_matplotlib_deprecation_warning ():
851
+ with _api . suppress_matplotlib_deprecation_warning ():
852
852
if config ['datapath' ] is None :
853
853
config ['datapath' ] = _get_data_path ()
854
854
else :
@@ -879,7 +879,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
879
879
rcParams = RcParams () # The global instance.
880
880
dict .update (rcParams , dict .items (rcParamsDefault ))
881
881
dict .update (rcParams , _rc_params_in_file (matplotlib_fname ()))
882
- with cbook . _suppress_matplotlib_deprecation_warning ():
882
+ with _api . suppress_matplotlib_deprecation_warning ():
883
883
rcParamsOrig = RcParams (rcParams .copy ())
884
884
# This also checks that all rcParams are indeed listed in the template.
885
885
# Assigning to rcsetup.defaultParams is left only for backcompat.
@@ -987,7 +987,7 @@ def rcdefaults():
987
987
"""
988
988
# Deprecation warnings were already handled when creating rcParamsDefault,
989
989
# no need to reemit them here.
990
- with cbook . _suppress_matplotlib_deprecation_warning ():
990
+ with _api . suppress_matplotlib_deprecation_warning ():
991
991
from .style .core import STYLE_BLACKLIST
992
992
rcParams .clear ()
993
993
rcParams .update ({k : v for k , v in rcParamsDefault .items ()
@@ -1003,7 +1003,7 @@ def rc_file_defaults():
1003
1003
"""
1004
1004
# Deprecation warnings were already handled when creating rcParamsOrig, no
1005
1005
# need to reemit them here.
1006
- with cbook . _suppress_matplotlib_deprecation_warning ():
1006
+ with _api . suppress_matplotlib_deprecation_warning ():
1007
1007
from .style .core import STYLE_BLACKLIST
1008
1008
rcParams .update ({k : rcParamsOrig [k ] for k in rcParamsOrig
1009
1009
if k not in STYLE_BLACKLIST })
@@ -1028,7 +1028,7 @@ def rc_file(fname, *, use_default_template=True):
1028
1028
"""
1029
1029
# Deprecation warnings were already handled in rc_params_from_file, no need
1030
1030
# to reemit them here.
1031
- with cbook . _suppress_matplotlib_deprecation_warning ():
1031
+ with _api . suppress_matplotlib_deprecation_warning ():
1032
1032
from .style .core import STYLE_BLACKLIST
1033
1033
rc_from_file = rc_params_from_file (
1034
1034
fname , use_default_template = use_default_template )
0 commit comments