@@ -102,7 +102,7 @@ class TransformNode:
102
102
# Some metadata about the transform, used to determine whether an
103
103
# invalidation is affine-only
104
104
is_affine = False
105
- is_bbox = False
105
+ is_bbox = _api . deprecated ( "3.9" )( _api . classproperty ( lambda cls : False ))
106
106
107
107
pass_through = False
108
108
"""
@@ -220,7 +220,7 @@ class BboxBase(TransformNode):
220
220
and height, but these are not stored explicitly.
221
221
"""
222
222
223
- is_bbox = True
223
+ is_bbox = _api . deprecated ( "3.9" )( _api . classproperty ( lambda cls : True ))
224
224
is_affine = True
225
225
226
226
if DEBUG :
@@ -1101,8 +1101,7 @@ def __init__(self, bbox, transform, **kwargs):
1101
1101
bbox : `Bbox`
1102
1102
transform : `Transform`
1103
1103
"""
1104
- if not bbox .is_bbox :
1105
- raise ValueError ("'bbox' is not a bbox" )
1104
+ _api .check_isinstance (BboxBase , bbox = bbox )
1106
1105
_api .check_isinstance (Transform , transform = transform )
1107
1106
if transform .input_dims != 2 or transform .output_dims != 2 :
1108
1107
raise ValueError (
@@ -1190,9 +1189,7 @@ def __init__(self, bbox, x0=None, y0=None, x1=None, y1=None, **kwargs):
1190
1189
The locked value for y1, or None to leave unlocked.
1191
1190
1192
1191
"""
1193
- if not bbox .is_bbox :
1194
- raise ValueError ("'bbox' is not a bbox" )
1195
-
1192
+ _api .check_isinstance (BboxBase , bbox = bbox )
1196
1193
super ().__init__ (** kwargs )
1197
1194
self ._bbox = bbox
1198
1195
self .set_children (bbox )
@@ -2547,8 +2544,7 @@ def __init__(self, boxin, boxout, **kwargs):
2547
2544
Create a new `BboxTransform` that linearly transforms
2548
2545
points from *boxin* to *boxout*.
2549
2546
"""
2550
- if not boxin .is_bbox or not boxout .is_bbox :
2551
- raise ValueError ("'boxin' and 'boxout' must be bbox" )
2547
+ _api .check_isinstance (BboxBase , boxin = boxin , boxout = boxout )
2552
2548
2553
2549
super ().__init__ (** kwargs )
2554
2550
self ._boxin = boxin
@@ -2591,8 +2587,7 @@ def __init__(self, boxout, **kwargs):
2591
2587
Create a new `BboxTransformTo` that linearly transforms
2592
2588
points from the unit bounding box to *boxout*.
2593
2589
"""
2594
- if not boxout .is_bbox :
2595
- raise ValueError ("'boxout' must be bbox" )
2590
+ _api .check_isinstance (BboxBase , boxout = boxout )
2596
2591
2597
2592
super ().__init__ (** kwargs )
2598
2593
self ._boxout = boxout
@@ -2646,8 +2641,7 @@ class BboxTransformFrom(Affine2DBase):
2646
2641
is_separable = True
2647
2642
2648
2643
def __init__ (self , boxin , ** kwargs ):
2649
- if not boxin .is_bbox :
2650
- raise ValueError ("'boxin' must be bbox" )
2644
+ _api .check_isinstance (BboxBase , boxin = boxin )
2651
2645
2652
2646
super ().__init__ (** kwargs )
2653
2647
self ._boxin = boxin
0 commit comments