Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd549f9

Browse files
committed
Deprecate unused, untested Affine2D.identity().
`Affine2D()` is exactly identical (it's the implementation...), shorter to type, and we have clearly standardized on using that; removing identity() also avoids any possible confusion with IdentityTransform (see also the removed docstring).
1 parent 91e8ea1 commit bd549f9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``Affine2D.indentity()``
2+
~~~~~~~~~~~~~~~~~~~~~~~~
3+
... is deprecated in favor of directly calling the `.Affine2D` constructor with
4+
no arguments.

lib/matplotlib/transforms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,7 @@ def set(self, other):
19571957
self._mtx = other.get_matrix()
19581958
self.invalidate()
19591959

1960+
@_api.deprecated("3.6", alternative="Affine2D()")
19601961
@staticmethod
19611962
def identity():
19621963
"""

0 commit comments

Comments
 (0)