File tree 9 files changed +17
-16
lines changed
api/next_api_changes/deprecations
9 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 1
1
``rcsetup.interactive_bk ``, ``rcsetup.non_interactive_bk `` and ``rcsetup.all_backends ``
2
2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
3
4
- ... are deprecated and replaced by
5
- :meth: `matplotlib.backends.registry.BackendRegistry.list_builtin `
4
+ ... are deprecated and replaced by ``matplotlib.backends.backend_registry.list_builtin ``
6
5
with the following arguments
7
6
8
- - `matplotlib.backends.registry. BackendFilter.INTERACTIVE `
9
- - `matplotlib.backends.registry. BackendFilter.NON_INTERACTIVE `
7
+ - `` matplotlib.backends.BackendFilter.INTERACTIVE ` `
8
+ - `` matplotlib.backends.BackendFilter.NON_INTERACTIVE ` `
10
9
- ``None ``
11
10
12
11
respectively.
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ BackendRegistry
3
3
4
4
New :class: `~matplotlib.backends.registry.BackendRegistry ` class is the single
5
5
source of truth for available backends. The singleton instance is
6
- ``matplotlib.backends.registry. backend_registry ``.
6
+ ``matplotlib.backends.backend_registry ``.
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def _safe_pyplot_import():
105
105
if current_framework is None :
106
106
raise # No, something else went wrong, likely with the install...
107
107
108
- from matplotlib .backends . registry import backend_registry
108
+ from matplotlib .backends import backend_registry
109
109
backend = backend_registry .backend_for_gui_framework (current_framework )
110
110
if backend is None :
111
111
raise RuntimeError ("No suitable backend for the current GUI framework "
Original file line number Diff line number Diff line change
1
+ from .registry import BackendFilter , backend_registry # noqa: F401
2
+
1
3
# NOTE: plt.switch_backend() (called at import time) will add a "backend"
2
4
# attribute here for backcompat.
3
5
_QT_FORCE_QT5_BINDING = False
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class BackendRegistry:
18
18
This is the single source of truth for available backends.
19
19
20
20
All use of ``BackendRegistry`` should be via the singleton instance
21
- ``backend_registry``.
21
+ ``backend_registry`` which can be imported from ``matplotlib.backends`` .
22
22
23
23
.. versionadded:: 3.9
24
24
"""
Original file line number Diff line number Diff line change 69
69
from matplotlib .artist import Artist
70
70
from matplotlib .axes import Axes
71
71
from matplotlib .axes import Subplot # noqa: F401
72
- from matplotlib .backends . registry import BackendFilter , backend_registry
72
+ from matplotlib .backends import BackendFilter , backend_registry
73
73
from matplotlib .projections import PolarAxes # type: ignore
74
74
from matplotlib import mlab # for detrend_none, window_hanning
75
75
from matplotlib .scale import get_scale_names # noqa: F401
Original file line number Diff line number Diff line change 23
23
import numpy as np
24
24
25
25
from matplotlib import _api , cbook
26
- from matplotlib .backends . registry import BackendFilter , backend_registry
26
+ from matplotlib .backends import BackendFilter , backend_registry
27
27
from matplotlib .cbook import ls_mapper
28
28
from matplotlib .colors import Colormap , is_color_like
29
29
from matplotlib ._fontconfig_pattern import parse_fontconfig_pattern
37
37
class __getattr__ :
38
38
@_api .deprecated (
39
39
"3.9" ,
40
- alternative = "``matplotlib.backends.registry. backend_registry.list_builtin"
41
- "(matplotlib.backends.registry. BackendFilter.INTERACTIVE)``" )
40
+ alternative = "``matplotlib.backends.backend_registry.list_builtin"
41
+ "(matplotlib.backends.BackendFilter.INTERACTIVE)``" )
42
42
@property
43
43
def interactive_bk (self ):
44
44
return backend_registry .list_builtin (BackendFilter .INTERACTIVE )
45
45
46
46
@_api .deprecated (
47
47
"3.9" ,
48
- alternative = "``matplotlib.backends.registry. backend_registry.list_builtin"
49
- "(matplotlib.backends.registry. BackendFilter.NON_INTERACTIVE)``" )
48
+ alternative = "``matplotlib.backends.backend_registry.list_builtin"
49
+ "(matplotlib.backends.BackendFilter.NON_INTERACTIVE)``" )
50
50
@property
51
51
def non_interactive_bk (self ):
52
52
return backend_registry .list_builtin (BackendFilter .NON_INTERACTIVE )
53
53
54
54
@_api .deprecated (
55
55
"3.9" ,
56
- alternative = "``matplotlib.backends.registry. backend_registry.list_builtin()``" )
56
+ alternative = "``matplotlib.backends.backend_registry.list_builtin()``" )
57
57
@property
58
58
def all_backends (self ):
59
59
return backend_registry .list_builtin ()
Original file line number Diff line number Diff line change 4
4
import pytest
5
5
6
6
import matplotlib as mpl
7
- from matplotlib .backends . registry import BackendFilter , backend_registry
7
+ from matplotlib .backends import BackendFilter , backend_registry
8
8
9
9
10
10
def has_duplicates (seq : Sequence [Any ]) -> bool :
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def parse(key):
56
56
backends += [e .strip () for e in line .split (',' ) if e ]
57
57
return backends
58
58
59
- from matplotlib .backends . registry import BackendFilter , backend_registry
59
+ from matplotlib .backends import BackendFilter , backend_registry
60
60
61
61
assert (set (parse ('- interactive backends:\n ' )) ==
62
62
set (backend_registry .list_builtin (BackendFilter .INTERACTIVE )))
You can’t perform that action at this time.
0 commit comments