Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit01049f1

Browse files
committed
Mixin version
1 parent9732a3f commit01049f1

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

‎lib/matplotlib/scale.py

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

8181

82-
classTransformScaleBase(Transform):
83-
"""Base transform for scales to allow a deep copy"""
82+
classCopyableTransformMixin():
83+
"""
84+
Mixin to support copy and deep copy on transforms. This alows scales,
85+
and hence norms, to be copyable.
86+
"""
8487
def__deepcopy__(self,memo):
8588
returnself.frozen()
8689

90+
__copy__=__deepcopy__
91+
8792

88-
classLinearTransform(TransformScaleBase,IdentityTransform):
89-
"""Mixed class for Identity"""
93+
classLinearTransform(CopyableTransformMixin,IdentityTransform):
9094
pass
9195

9296

@@ -124,9 +128,9 @@ def get_transform(self):
124128
returnLinearTransform()
125129

126130

127-
classFuncTransform(TransformScaleBase):
131+
classFuncTransform(CopyableTransformMixin,Transform):
128132
"""
129-
Asimpletransform that takes and arbitrary function for the
133+
A transform that takes and arbitrary function for the
130134
forward and inverse transform.
131135
"""
132136

@@ -202,7 +206,7 @@ def set_default_locators_and_formatters(self, axis):
202206
axis.set_minor_locator(NullLocator())
203207

204208

205-
classLogTransform(TransformScaleBase):
209+
classLogTransform(CopyableTransformMixin,Transform):
206210
input_dims=output_dims=1
207211

208212
@_api.rename_parameter("3.3","nonpos","nonpositive")
@@ -244,7 +248,7 @@ def inverted(self):
244248
returnInvertedLogTransform(self.base)
245249

246250

247-
classInvertedLogTransform(TransformScaleBase):
251+
classInvertedLogTransform(CopyableTransformMixin,Transform):
248252
input_dims=output_dims=1
249253

250254
def__init__(self,base):
@@ -370,7 +374,7 @@ def get_transform(self):
370374
returnself._transform
371375

372376

373-
classSymmetricalLogTransform(TransformScaleBase):
377+
classSymmetricalLogTransform(CopyableTransformMixin,Transform):
374378
input_dims=output_dims=1
375379

376380
def__init__(self,base,linthresh,linscale):
@@ -402,7 +406,7 @@ def inverted(self):
402406
self.linscale)
403407

404408

405-
classInvertedSymmetricalLogTransform(TransformScaleBase):
409+
classInvertedSymmetricalLogTransform(CopyableTransformMixin,Transform):
406410
input_dims=output_dims=1
407411

408412
def__init__(self,base,linthresh,linscale):
@@ -505,7 +509,7 @@ def get_transform(self):
505509
returnself._transform
506510

507511

508-
classLogitTransform(TransformScaleBase):
512+
classLogitTransform(CopyableTransformMixin,Transform):
509513
input_dims=output_dims=1
510514

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

533537

534-
classLogisticTransform(TransformScaleBase):
538+
classLogisticTransform(CopyableTransformMixin,Transform):
535539
input_dims=output_dims=1
536540

537541
@_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
assertbase64.b64encode(png).decode('ascii')inhtml
12711271
assertcmap.nameinhtml
1272-
<<<<<<<HEAD
12731272
asserthtml.startswith('<div')
12741273
asserthtml.endswith('</div>')
12751274

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp