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

Commitf7a42e6

Browse files
committed
Remove deprecations: is_bbox and more
1 parent759765c commitf7a42e6

File tree

8 files changed

+27
-82
lines changed

8 files changed

+27
-82
lines changed
Lines 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. If you rely on this, please make a copy of old the code.
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

Lines 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-
defstart(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-
ifintervalisnotNone:
1082-
self.interval=interval
1070+
defstart(self):
1071+
"""Start the timer."""
10831072
self._timer_start()
10841073

10851074
defstop(self):

‎lib/matplotlib/backend_bases.pyi

Lines 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-
defstart(self,interval:int|None= ...)->None: ...
189+
defstart(self)->None: ...
190190
defstop(self)->None: ...
191191
@property
192192
definterval(self)->int: ...

‎lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
importmatplotlibasmpl
2626
frommatplotlibimport_api,cbook
27-
frommatplotlib.backendsimportBackendFilter,backend_registry
27+
frommatplotlib.backendsimportbackend_registry
2828
frommatplotlib.cbookimportls_mapper
2929
frommatplotlib.colorsimportColormap,is_color_like
3030
frommatplotlib._fontconfig_patternimportparse_fontconfig_pattern
@@ -34,32 +34,6 @@
3434
fromcyclerimportCycler,cyclerasccycler
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-
definteractive_bk(self):
45-
returnbackend_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-
defnon_interactive_bk(self):
53-
returnbackend_registry.list_builtin(BackendFilter.NON_INTERACTIVE)
54-
55-
@_api.deprecated(
56-
"3.9",
57-
alternative="``matplotlib.backends.backend_registry.list_builtin()``")
58-
@property
59-
defall_backends(self):
60-
returnbackend_registry.list_builtin()
61-
62-
6337
classValidateInStrings:
6438
def__init__(self,key,valid,ignorecase=False,*,
6539
_deprecated_since=None):

‎lib/matplotlib/rcsetup.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ from collections.abc import Callable, Iterable
44
fromtypingimportAny,Literal,TypeVar
55
frommatplotlib.typingimportColorType,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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
importpytest
55

6-
importmatplotlibasmpl
76
frommatplotlib.backendsimportBackendFilter,backend_registry
87

98

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

9796

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

‎lib/matplotlib/transforms.py

Lines 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(lambdacls: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(lambdacls:True))
220218
is_affine=True
221219

222220
ifDEBUG:
@@ -2627,27 +2625,6 @@ def get_matrix(self):
26272625
returnself._mtx
26282626

26292627

2630-
@_api.deprecated("3.9")
2631-
classBboxTransformToMaxOnly(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-
defget_matrix(self):
2637-
# docstring inherited
2638-
ifself._invalid:
2639-
xmax,ymax=self._boxout.max
2640-
ifDEBUGand (xmax==0orymax==0):
2641-
raiseValueError("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-
returnself._mtx
2649-
2650-
26512628
classBboxTransformFrom(Affine2DBase):
26522629
"""
26532630
`BboxTransformFrom` linearly transforms points from a given `Bbox` to the

‎lib/matplotlib/transforms.pyi

Lines 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
defis_affine(self)->bool: ...
@@ -24,7 +23,6 @@ class TransformNode:
2423
deffrozen(self)->TransformNode: ...
2524

2625
classBboxBase(TransformNode):
27-
is_bbox:bool
2826
is_affine:bool
2927
deffrozen(self)->Bbox: ...
3028
def__array__(self,*args,**kwargs): ...
@@ -295,8 +293,6 @@ class BboxTransform(Affine2DBase):
295293
classBboxTransformTo(Affine2DBase):
296294
def__init__(self,boxout:BboxBase,**kwargs)->None: ...
297295

298-
classBboxTransformToMaxOnly(BboxTransformTo): ...
299-
300296
classBboxTransformFrom(Affine2DBase):
301297
def__init__(self,boxin:BboxBase,**kwargs)->None: ...
302298

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp