8000 Rename more parameters for consistency with superclass method paramet… · matplotlib/matplotlib@9769ea0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9769ea0

Browse files
committed
Rename more parameters for consistency with superclass method parameter names
1 parent d608278 commit 9769ea0

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ matplotlib.ticker.MultipleLocator.set_params
6464
matplotlib.text.Annotation.get_window_extent
6565

6666
# Inconsistent super/sub class parameter name (maybe rename for consistency)
67-
matplotlib.axis.Axis.set_clip_path
68-
matplotlib.axis.Tick.set_clip_path
69-
matplotlib.image.NonUniformImage.set_filternorm
70-
matplotlib.image.NonUniformImage.set_filterrad
7167
matplotlib.projections.polar.RadialLocator.nonsingular
72-
matplotlib.table.Cell.set_transform
68+
#matplotlib.table.Cell.set_transform
7369
matplotlib.ticker.LogLocator.nonsingular
7470
matplotlib.ticker.LogitLocator.nonsingular
7571

lib/matplotlib/axis.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ def get_children(self):
229229
self.gridline, self.label1, self.label2]
230230
return children
231231

232-
def set_clip_path(self, clippath, transform=None):
232+
@_api.rename_parameter("3.8", "clippath", "path")
233+
def set_clip_path(self, path, transform=None):
233234
# docstring inherited
234-
super().set_clip_path(clippath, transform)
235-
self.gridline.set_clip_path(clippath, transform)
235+
super().set_clip_path(path, transform)
236+
self.gridline.set_clip_path(path, transform)
236237
self.stale = True
237238

238239
def contains(self, mouseevent):
@@ -1079,10 +1080,11 @@ def _translate_tick_params(kw, reverse=False):
10791080
kwtrans.update(kw_)
10801081
return kwtrans
10811082

1082-
def set_clip_path(self, clippath, transform=None):
1083-
super().set_clip_path(clippath, transform)
1083+
@_api.rename_parameter("3.8", "clippath", "path")
1084+
def set_clip_path(self, path, transform=None):
1085+
super().set_clip_path(path, transform)
10841086
for child in self.majorTicks + self.minorTicks:
1085-
child.set_clip_path(clippath, transform)
1087+
child.set_clip_path(path, transform)
10861088
self.stale = True
10871089

10881090
def get_view_interval(self):

lib/matplotlib/image.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,10 +1188,12 @@ def get_extent(self):
11881188
raise RuntimeError('Must set data first')
11891189
return self._Ax[0], self._Ax[-1], self._Ay[0], self._Ay[-1]
11901190

1191-
def set_filternorm(self, s):
1191+
@_api.rename_parameter("3.8", "s", "filternorm")
1192+
def set_filternorm(self, filternorm):
11921193
pass
11931194

1194-
def set_filterrad(self, s):
1195+
@_api.rename_parameter("3.8", "s", "filterrad")
1196+
def set_filterrad(self, filterrad):
11951197
pass
11961198

11971199
def set_norm(self, norm):

lib/matplotlib/table.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ def __init__(self, xy, width, height, *,
102102
text=text, fontproperties=fontproperties,
103103
horizontalalignment=loc, verticalalignment='center')
104104

105-
def set_transform(self, trans):
106-
super().set_transform(trans)
105+
@_api.rename_parameter("3.8", "trans", "t")
106+
def set_transform(self, t):
107+
super().set_transform(t)
107108
# the text does not get the transform!
108109
self.stale = True
109110

0 commit comments

Comments
 (0)
0