@@ -1702,17 +1702,9 @@ def set(self, child):
17021702 self .invalidate ()
17031703 self ._invalid = 0
17041704
1705- def _get_is_affine (self ):
1706- return self ._child .is_affine
1707- is_affine = property (_get_is_affine )
1708-
1709- def _get_is_separable (self ):
1710- return self ._child .is_separable
1711- is_separable = property (_get_is_separable )
1712-
1713- def _get_has_inverse (self ):
1714- return self ._child .has_inverse
1715- has_inverse = property (_get_has_inverse )
1705+ is_affine = property (lambda self : self ._child .is_affine )
1706+ is_separable = property (lambda self : self ._child .is_separable )
1707+ has_inverse = property (lambda self : self ._child .has_inverse )
17161708
17171709
17181710class AffineBase (Transform ):
@@ -1799,10 +1791,10 @@ def frozen(self):
17991791 return Affine2D (self .get_matrix ().copy ())
18001792 frozen .__doc__ = AffineBase .frozen .__doc__
18011793
1802- def _get_is_separable (self ):
1794+ @property
1795+ def is_separable (self ):
18031796 mtx = self .get_matrix ()
1804- return mtx [0 , 1 ] == 0.0 and mtx [1 , 0 ] == 0.0
1805- is_separable = property (_get_is_separable )
1797+ return mtx [0 , 1 ] == mtx [1 , 0 ] == 0.0
18061798
18071799 def to_values (self ):
18081800 """
@@ -2075,11 +2067,6 @@ def skew_deg(self, xShear, yShear):
20752067 """
20762068 return self .skew (np .deg2rad (xShear ), np .deg2rad (yShear ))
20772069
2078- def _get_is_separable (self ):
2079- mtx = self .get_matrix ()
2080- return mtx [0 , 1 ] == 0.0 and mtx [1 , 0 ] == 0.0
2081- is_separable = property (_get_is_separable )
2082-
20832070
20842071class IdentityTransform (Affine2DBase ):
20852072 """
@@ -2181,13 +2168,9 @@ def contains_branch(self, other):
21812168 # a blended transform cannot possibly contain a branch from two different transforms.
21822169 return False
21832170
2184- def _get_is_affine (self ):
2185- return self ._x .is_affine and self ._y .is_affine
2186- is_affine = property (_get_is_affine )
2187-
2188- def _get_has_inverse (self ):
2189- return self ._x .has_inverse and self ._y .has_inverse
2190- has_inverse = property (_get_has_inverse )
2171+ is_affine = property (lambda self : self ._x .is_affine and self ._y .is_affine )
2172+ has_inverse = property (
2173+ lambda self : self ._x .has_inverse and self ._y .has_inverse )
21912174
21922175 def frozen (self ):
21932176 return blended_transform_factory (self ._x .frozen (), self ._y .frozen ())
@@ -2410,17 +2393,12 @@ def _iter_break_from_left_to_right(self):
24102393 for left , right in self ._b ._iter_break_from_left_to_right ():
24112394 yield self ._a + left , right
24122395
2413- @property
2414- def depth (self ):
2415- return self ._a .depth + self ._b .depth
2416-
2417- def _get_is_affine (self ):
2418- return self ._a .is_affine and self ._b .is_affine
2419- is_affine = property (_get_is_affine )
2420-
2421- def _get_is_separable (self ):
2422- return self ._a .is_separable and self ._b .is_separable
2423- is_separable = property (_get_is_separable )
2396+ depth = property (lambda self : self ._a .depth + self ._b .depth )
2397+ is_affine = property (lambda self : self ._a .is_affine and self ._b .is_affine )
2398+ is_separable = property (
2399+ lambda self : self ._a .is_separable and self ._b .is_separable )
2400+ has_inverse = property (
2401+ lambda self : self ._a .has_inverse and self ._b .has_inverse )
24242402
24252403 def __str__ (self ):
24262404 return ("{}(\n "
@@ -2466,10 +2444,6 @@ def inverted(self):
24662444 return CompositeGenericTransform (self ._b .inverted (), self ._a .inverted ())
24672445 inverted .__doc__ = Transform .inverted .__doc__
24682446
2469- def _get_has_inverse (self ):
2470- return self ._a .has_inverse and self ._b .has_inverse
2471- has_inverse = property (_get_has_inverse )
2472-
24732447
24742448class CompositeAffine2D (Affine2DBase ):
24752449 """
0 commit comments