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 4699c0c

Browse filesBrowse files
committed
FIX: remove LinearTransform
1 parent 2a2a68f commit 4699c0c
Copy full SHA for 4699c0c

File tree

Expand file treeCollapse file tree

3 files changed

+13
-9
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+13
-9
lines changed

‎lib/matplotlib/scale.py

Copy file name to clipboardExpand all lines: lib/matplotlib/scale.py
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ def __deepcopy__(self, memo):
9090
__copy__ = __deepcopy__
9191

9292

93-
class LinearTransform(_CopyableTransformMixin, IdentityTransform):
94-
pass
95-
96-
9793
class LinearScale(ScaleBase):
9894
"""
9995
The default linear scale.
@@ -125,7 +121,7 @@ def get_transform(self):
125121
Return the transform for linear scaling, which is just the
126122
`~matplotlib.transforms.IdentityTransform`.
127123
"""
128-
return LinearTransform()
124+
return IdentityTransform()
129125

130126

131127
class FuncTransform(_CopyableTransformMixin, Transform):

‎lib/matplotlib/tests/test_transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_transforms.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ def test_str_transform():
501501
CompositeGenericTransform(
502502
TransformWrapper(
503503
BlendedAffine2D(
504-
LinearTransform(),
505-
LinearTransform())),
504+
IdentityTransform(),
505+
IdentityTransform())),
506506
CompositeAffine2D(
507507
Affine2D(
508508
[[1. 0. 0.]
@@ -521,8 +521,8 @@ def test_str_transform():
521521
PolarAffine(
522522
TransformWrapper(
523523
BlendedAffine2D(
524-
LinearTransform(),
525-
LinearTransform())),
524+
IdentityTransform(),
525+
IdentityTransform())),
526526
LockableBbox(
527527
Bbox(x0=0.0, y0=0.0, x1=6.283185307179586, y1=1.0),
528528
[[-- --]

‎lib/matplotlib/transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,14 @@ def frozen(self):
20622062
# docstring inherited
20632063
return self
20642064

2065+
def __deepcopy__(self, memo):
2066+
"""
2067+
The identity transform does not need to lock out deepcopy
2068+
"""
2069+
return self.frozen()
2070+
2071+
__copy__ = __deepcopy__
2072+
20652073
__str__ = _make_str_method()
20662074

20672075
def get_matrix(self):

0 commit comments

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