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 f9d4ed2

Browse filesBrowse files
committed
Remove deprecations: is_bbox and more
1 parent cf6069a commit f9d4ed2
Copy full SHA for f9d4ed2

File tree

Expand file treeCollapse file tree

8 files changed

+27
-82
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+27
-82
lines changed
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
``TransformNode.is_bbox``
2+
^^^^^^^^^^^^^^^^^^^^^^^^^
3+
4+
... is removed. Instead check the object using ``isinstance(..., BboxBase)``.
5+
6+
``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends``
7+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8+
9+
... are removed and replaced by ``matplotlib.backends.backend_registry.list_builtin``
10+
with the following arguments
11+
12+
- ``matplotlib.backends.BackendFilter.INTERACTIVE``
13+
- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE``
14+
- ``None``
15+
16+
``BboxTransformToMaxOnly``
17+
^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
... is removed. It can be replaced by ``BboxTransformTo(LockableBbox(bbox, x0=0, y0=0))``.
20+
21+
*interval* parameter of ``TimerBase.start``
22+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
The timer interval parameter can no longer be set while starting it. The interval can be specified instead in the timer constructor, or by setting the timer.interval attribute.

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+2-13Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,19 +1067,8 @@ def __del__(self):
10671067
"""Need to stop timer and possibly disconnect timer."""
10681068
self._timer_stop()
10691069

1070-
@_api.delete_parameter("3.9", "interval", alternative="timer.interval")
1071-
def start(self, interval=None):
1072-
"""
1073-
Start the timer object.
1074-
1075-
Parameters
1076-
----------
1077-
interval : int, optional
1078-
Timer interval in milliseconds; overrides a previously set interval
1079-
if provided.
1080-
"""
1081-
if interval is not None:
1082-
self.interval = interval
1070+
def start(self):
1071+
"""Start the timer."""
10831072
self._timer_start()
10841073

10851074
def stop(self):

‎lib/matplotlib/backend_bases.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.pyi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class TimerBase:
186186
callbacks: list[tuple[Callable, tuple, dict[str, Any]]] | None = ...,
187187
) -> None: ...
188188
def __del__(self) -> None: ...
189-
def start(self, interval: int | None = ...) -> None: ...
189+
def start(self) -> None: ...
190190
def stop(self) -> None: ...
191191
@property
192192
def interval(self) -> int: ...

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+1-27Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import matplotlib as mpl
2626
from matplotlib import _api, cbook
27-
from matplotlib.backends import BackendFilter, backend_registry
27+
from matplotlib.backends import backend_registry
2828
from matplotlib.cbook import ls_mapper
2929
from matplotlib.colors import Colormap, is_color_like
3030
from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
@@ -34,32 +34,6 @@
3434
from cycler import Cycler, cycler as ccycler
3535

3636

37-
@_api.caching_module_getattr
38-
class __getattr__:
39-
@_api.deprecated(
40-
"3.9",
41-
alternative="``matplotlib.backends.backend_registry.list_builtin"
42-
"(matplotlib.backends.BackendFilter.INTERACTIVE)``")
43-
@property
44-
def interactive_bk(self):
45-
return backend_registry.list_builtin(BackendFilter.INTERACTIVE)
46-
47-
@_api.deprecated(
48-
"3.9",
49-
alternative="``matplotlib.backends.backend_registry.list_builtin"
50-
"(matplotlib.backends.BackendFilter.NON_INTERACTIVE)``")
51-
@property
52-
def non_interactive_bk(self):
53-
return backend_registry.list_builtin(BackendFilter.NON_INTERACTIVE)
54-
55-
@_api.deprecated(
56-
"3.9",
57-
alternative="``matplotlib.backends.backend_registry.list_builtin()``")
58-
@property
59-
def all_backends(self):
60-
return backend_registry.list_builtin()
61-
62-
6337
class ValidateInStrings:
6438
def __init__(self, key, valid, ignorecase=False, *,
6539
_deprecated_since=None):

‎lib/matplotlib/rcsetup.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.pyi
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ from collections.abc import Callable, Iterable
44
from typing import Any, Literal, TypeVar
55
from matplotlib.typing import ColorType, LineStyleType, MarkEveryType
66

7-
interactive_bk: list[str]
8-
non_interactive_bk: list[str]
9-
all_backends: list[str]
107

118
_T = TypeVar("_T")
129

‎lib/matplotlib/tests/test_backend_registry.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_registry.py
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55

6-
import matplotlib as mpl
76
from matplotlib.backends import BackendFilter, backend_registry
87

98

@@ -95,16 +94,6 @@ def test_backend_normalization(backend, normalized):
9594
assert backend_registry._backend_module_name(backend) == normalized
9695

9796

98-
def test_deprecated_rcsetup_attributes():
99-
match = "was deprecated in Matplotlib 3.9"
100-
with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match):
101-
mpl.rcsetup.interactive_bk
102-
with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match):
103-
mpl.rcsetup.non_interactive_bk
104-
with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match):
105-
mpl.rcsetup.all_backends
106-
107-
10897
def test_entry_points_inline():
10998
pytest.importorskip('matplotlib_inline')
11099
backends = backend_registry.list_all()

‎lib/matplotlib/transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.py
-23Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class TransformNode:
9898
# Some metadata about the transform, used to determine whether an
9999
# invalidation is affine-only
100100
is_affine = False
101-
is_bbox = _api.deprecated("3.9")(_api.classproperty(lambda cls: False))
102101

103102
pass_through = False
104103
"""
@@ -216,7 +215,6 @@ class BboxBase(TransformNode):
216215
and height, but these are not stored explicitly.
217216
"""
218217

219-
is_bbox = _api.deprecated("3.9")(_api.classproperty(lambda cls: True))
220218
is_affine = True
221219

222220
if DEBUG:
@@ -2627,27 +2625,6 @@ def get_matrix(self):
26272625
return self._mtx
26282626

26292627

2630-
@_api.deprecated("3.9")
2631-
class BboxTransformToMaxOnly(BboxTransformTo):
2632-
"""
2633-
`BboxTransformToMaxOnly` is a transformation that linearly transforms points from
2634-
the unit bounding box to a given `Bbox` with a fixed upper left of (0, 0).
2635-
"""
2636-
def get_matrix(self):
2637-
# docstring inherited
2638-
if self._invalid:
2639-
xmax, ymax = self._boxout.max
2640-
if DEBUG and (xmax == 0 or ymax == 0):
2641-
raise ValueError("Transforming to a singular bounding box.")
2642-
self._mtx = np.array([[xmax, 0.0, 0.0],
2643-
[ 0.0, ymax, 0.0],
2644-
[ 0.0, 0.0, 1.0]],
2645-
float)
2646-
self._inverted = None
2647-
self._invalid = 0
2648-
return self._mtx
2649-
2650-
26512628
class BboxTransformFrom(Affine2DBase):
26522629
"""
26532630
`BboxTransformFrom` linearly transforms points from a given `Bbox` to the

‎lib/matplotlib/transforms.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.pyi
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class TransformNode:
1212
INVALID_NON_AFFINE: int
1313
INVALID_AFFINE: int
1414
INVALID: int
15-
is_bbox: bool
1615
# Implemented as a standard attr in base class, but functionally readonly and some subclasses implement as such
1716
@property
1817
def is_affine(self) -> bool: ...
@@ -24,7 +23,6 @@ class TransformNode:
2423
def frozen(self) -> TransformNode: ...
2524

2625
class BboxBase(TransformNode):
27-
is_bbox: bool
2826
is_affine: bool
2927
def frozen(self) -> Bbox: ...
3028
def __array__(self, *args, **kwargs): ...
@@ -295,8 +293,6 @@ class BboxTransform(Affine2DBase):
295293
class BboxTransformTo(Affine2DBase):
296294
def __init__(self, boxout: BboxBase, **kwargs) -> None: ...
297295

298-
class BboxTransformToMaxOnly(BboxTransformTo): ...
299-
300296
class BboxTransformFrom(Affine2DBase):
301297
def __init__(self, boxin: BboxBase, **kwargs) -> None: ...
302298

0 commit comments

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