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

Skip to content

Commit ed82fab

Browse files
committed
Mixin version
1 parent 9732a3f commit ed82fab

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

lib/matplotlib/scale.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ def limit_range_for_scale(self, vmin, vmax, minpos):
7979
return vmin, vmax
8080

8181

82-
class TransformScaleBase(Transform):
82+
class _TransformScaleCopyable():
8383
"""Base transform for scales to allow a deep copy"""
8484
def __deepcopy__(self, memo):
8585
return self.frozen()
8686

87+
__copy__ = __deepcopy__
8788

88-
class LinearTransform(TransformScaleBase, IdentityTransform):
89-
"""Mixed class for Identity"""
89+
class LinearTransform(_TransformScaleCopyable, IdentityTransform):
9090
pass
9191

9292

@@ -124,9 +124,9 @@ def get_transform(self):
124124
return LinearTransform()
125125

126126

127-
class FuncTransform(TransformScaleBase):
127+
class FuncTransform(_TransformScaleCopyable, Transform):
128128
"""
129-
A simple transform that takes and arbitrary function for the
129+
A transform that takes and arbitrary function for the
130130
forward and inverse transform.
131131
"""
132132

@@ -202,7 +202,7 @@ def set_default_locators_and_formatters(self, axis):
202202
axis.set_minor_locator(NullLocator())
203203

204204

205-
class LogTransform(TransformScaleBase):
205+
class LogTransform(_TransformScaleCopyable, Transform):
206206
input_dims = output_dims = 1
207207

208208
@_api.rename_parameter("3.3", "nonpos", "nonpositive")
@@ -244,7 +244,7 @@ def inverted(self):
244244
return InvertedLogTransform(self.base)
245245

246246

247-
class InvertedLogTransform(TransformScaleBase):
247+
class InvertedLogTransform(_TransformScaleCopyable, Transform):
248248
input_dims = output_dims = 1
249249

250250
def __init__(self, base):
@@ -370,7 +370,7 @@ def get_transform(self):
370370
return self._transform
371371

372372

373-
class SymmetricalLogTransform(TransformScaleBase):
373+
class SymmetricalLogTransform(_TransformScaleCopyable, Transform):
374374
input_dims = output_dims = 1
375375

376376
def __init__(self, base, linthresh, linscale):
@@ -402,7 +402,7 @@ def inverted(self):
402402
self.linscale)
403403

404404

405-
class InvertedSymmetricalLogTransform(TransformScaleBase):
405+
class InvertedSymmetricalLogTransform(_TransformScaleCopyable, Transform):
406406
input_dims = output_dims = 1
407407

408408
def __init__(self, base, linthresh, linscale):
@@ -505,7 +505,7 @@ def get_transform(self):
505505
return self._transform
506506

507507

508-
class LogitTransform(TransformScaleBase):
508+
class LogitTransform(_TransformScaleCopyable, Transform):
509509
input_dims = output_dims = 1
510510

511511
@_api.rename_parameter("3.3", "nonpos", "nonpositive")
@@ -531,7 +531,7 @@ def __str__(self):
531531
return "{}({!r})".format(type(self).__name__, self._nonpositive)
532532

533533

534-
class LogisticTransform(TransformScaleBase):
534+
class LogisticTransform(_TransformScaleCopyable, Transform):
535535
input_dims = output_dims = 1
536536

537537
@_api.rename_parameter("3.3", "nonpos", "nonpositive")

lib/matplotlib/tests/test_colors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,6 @@ def test_repr_html():
12691269
png = cmap._repr_png_()
12701270
assert base64.b64encode(png).decode('ascii') in html
12711271
assert cmap.name in html
1272-
<<<<<<< HEAD
12731272
assert html.startswith('<div')
12741273
assert html.endswith('</div>')
12751274

0 commit comments

Comments
 (0)