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 ac5d377

Browse filesBrowse files
committed
Replace *kw by *args.
and, when it occurs in the same file, `**kw` by `**kwargs`.
1 parent 114d516 commit ac5d377
Copy full SHA for ac5d377

File tree

Expand file treeCollapse file tree

7 files changed

+33
-34
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+33
-34
lines changed

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def _print_figure(
936936

937937
if dryrun:
938938
class NullWriter(object):
939-
def write(self, *kl, **kwargs):
939+
def write(self, *args, **kwargs):
940940
pass
941941

942942
self._pswriter = NullWriter()
@@ -1132,7 +1132,7 @@ def _print_figure_tex(
11321132

11331133
if dryrun:
11341134
class NullWriter(object):
1135-
def write(self, *kl, **kwargs):
1135+
def write(self, *args, **kwargs):
11361136
pass
11371137

11381138
self._pswriter = NullWriter()

‎lib/matplotlib/container.py

Copy file name to clipboardExpand all lines: lib/matplotlib/container.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def __repr__(self):
1414
return ("<{} object of {} artists>"
1515
.format(type(self).__name__, len(self)))
1616

17-
def __new__(cls, *kl, **kwargs):
18-
return tuple.__new__(cls, kl[0])
17+
def __new__(cls, *args, **kwargs):
18+
return tuple.__new__(cls, args[0])
1919

2020
def __init__(self, kl, label=None):
2121

‎lib/matplotlib/textpath.py

Copy file name to clipboardExpand all lines: lib/matplotlib/textpath.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class TextPath(Path):
403403

404404
def __init__(self, xy, s, size=None, prop=None,
405405
_interpolation_steps=1, usetex=False,
406-
*kl, **kwargs):
406+
*args, **kwargs):
407407
r"""
408408
Create a path from the text. Note that it simply is a path,
409409
not an artist. You need to use the `~.PathPatch` (or other artists)
@@ -449,7 +449,7 @@ def __init__(self, xy, s, size=None, prop=None,
449449
Also see :doc:`/gallery/text_labels_and_annotations/demo_text_path`.
450450
"""
451451

452-
if kl or kwargs:
452+
if args or kwargs:
453453
cbook.warn_deprecated(
454454
"3.1", message="Additional agruments to TextPath used to be "
455455
"ignored, but will trigger a TypeError %(removal)s.")

‎lib/mpl_toolkits/axes_grid1/mpl_axes.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/mpl_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def __getattr__(self, k):
1111
_a = SimpleChainedObjects([getattr(a, k) for a in self._objects])
1212
return _a
1313

14-
def __call__(self, *kl, **kwargs):
14+
def __call__(self, *args, **kwargs):
1515
for m in self._objects:
16-
m(*kl, **kwargs)
16+
m(*args, **kwargs)
1717

1818

1919
class Axes(maxes.Axes):

‎lib/mpl_toolkits/axisartist/axis_artist.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axis_artist.py
+21-22Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105

106106
class BezierPath(Line2D):
107107

108-
def __init__(self, path, *kl, **kw):
109-
Line2D.__init__(self, [], [], *kl, **kw)
108+
def __init__(self, path, *args, **kwargs):
109+
Line2D.__init__(self, [], [], *args, **kwargs)
110110
self._path = path
111111
self._invalid = False
112112

@@ -304,12 +304,12 @@ class LabelBase(mtext.Text):
304304
text_ref_angle, and offset_radius attributes.
305305
"""
306306

307-
def __init__(self, *kl, **kwargs):
307+
def __init__(self, *args, **kwargs):
308308
self.locs_angles_labels = []
309309
self._ref_angle = 0
310310
self._offset_radius = 0.
311311

312-
super().__init__(*kl, **kwargs)
312+
super().__init__(*args, **kwargs)
313313

314314
self.set_rotation_mode("anchor")
315315
self._text_follow_ref_angle = True
@@ -773,14 +773,14 @@ def __init__(self, axes,
773773
helper,
774774
offset=None,
775775
axis_direction="bottom",
776-
**kw):
776+
**kwargs):
777777
"""
778778
*axes* : axes
779779
*helper* : an AxisArtistHelper instance.
780780
"""
781781
#axes is also used to follow the axis attribute (tick color, etc).
782782

783-
super().__init__(**kw)
783+
super().__init__(**kwargs)
784784

785785
self.axes = axes
786786

@@ -809,7 +809,7 @@ def __init__(self, axes,
809809
self._axis_direction = axis_direction
810810

811811
self._init_line()
812-
self._init_ticks(axis_name, **kw)
812+
self._init_ticks(axis_name, **kwargs)
813813
self._init_offsetText(axis_direction)
814814
self._init_label()
815815

@@ -922,7 +922,7 @@ def get_helper(self):
922922
"""
923923
return self._axis_artist_helper
924924

925-
def set_axisline_style(self, axisline_style=None, **kw):
925+
def set_axisline_style(self, axisline_style=None, **kwargs):
926926
"""
927927
Set the axisline style.
928928
@@ -945,7 +945,7 @@ def set_axisline_style(self, axisline_style=None, **kw):
945945
if isinstance(axisline_style, AxislineStyle._Base):
946946
self._axisline_style = axisline_style
947947
else:
948-
self._axisline_style = AxislineStyle(axisline_style, **kw)
948+
self._axisline_style = AxislineStyle(axisline_style, **kwargs)
949949

950950
self._init_line()
951951

@@ -978,19 +978,19 @@ def _draw_line(self, renderer):
978978
self.line.set_line_mutation_scale(self.major_ticklabels.get_size())
979979
self.line.draw(renderer)
980980

981-
def _init_ticks(self, axis_name, **kw):
981+
def _init_ticks(self, axis_name, **kwargs):
982982

983983
trans = (self._axis_artist_helper.get_tick_transform(self.axes)
984984
+ self.offset_transform)
985985

986-
major_tick_size = kw.get("major_tick_size",
987-
rcParams['%s.major.size' % axis_name])
988-
major_tick_pad = kw.get("major_tick_pad",
989-
rcParams['%s.major.pad' % axis_name])
990-
minor_tick_size = kw.get("minor_tick_size",
991-
rcParams['%s.minor.size' % axis_name])
992-
minor_tick_pad = kw.get("minor_tick_pad",
993-
rcParams['%s.minor.pad' % axis_name])
986+
major_tick_size = kwargs.get("major_tick_size",
987+
rcParams[f'{axis_name}.major.size'])
988+
major_tick_pad = kwargs.get("major_tick_pad",
989+
rcParams[f'{axis_name}.major.pad'])
990+
minor_tick_size = kwargs.get("minor_tick_size",
991+
rcParams[f'{axis_name}.minor.size'])
992+
minor_tick_pad = kwargs.get("minor_tick_pad",
993+
rcParams[f'{axis_name}.minor.pad'])
994994

995995
self.major_ticks = Ticks(major_tick_size,
996996
axis=self.axis,
@@ -1162,9 +1162,8 @@ def _draw_offsetText(self, renderer):
11621162
self._update_offsetText()
11631163
self.offsetText.draw(renderer)
11641164

1165-
def _init_label(self, **kw):
1166-
labelsize = kw.get("labelsize",
1167-
rcParams['axes.labelsize'])
1165+
def _init_label(self, **kwargs):
1166+
labelsize = kwargs.get("labelsize", rcParams['axes.labelsize'])
11681167
fontprops = font_manager.FontProperties(
11691168
size=labelsize,
11701169
weight=rcParams['axes.labelweight'])
@@ -1182,7 +1181,7 @@ def _init_label(self, **kw):
11821181

11831182
self.label.set_figure(self.axes.figure)
11841183

1185-
labelpad = kw.get("labelpad", 5)
1184+
labelpad = kwargs.get("labelpad", 5)
11861185
self.label.set_pad(labelpad)
11871186

11881187
def _update_label(self, renderer):

‎lib/mpl_toolkits/axisartist/axislines.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axislines.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ def __getattr__(self, k):
495495
_a = SimpleChainedObjects([getattr(a, k) for a in self._objects])
496496
return _a
497497

498-
def __call__(self, *kl, **kwargs):
498+
def __call__(self, *args, **kwargs):
499499
for m in self._objects:
500-
m(*kl, **kwargs)
500+
m(*args, **kwargs)
501501

502502

503503
class Axes(maxes.Axes):

‎lib/mpl_toolkits/axisartist/floating_axes.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/floating_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,14 @@ def get_boundary(self):
387387

388388
class FloatingAxesBase(object):
389389

390-
def __init__(self, *kl, **kwargs):
390+
def __init__(self, *args, **kwargs):
391391
grid_helper = kwargs.get("grid_helper", None)
392392
if grid_helper is None:
393393
raise ValueError("FloatingAxes requires grid_helper argument")
394394
if not hasattr(grid_helper, "get_boundary"):
395395
raise ValueError("grid_helper must implement get_boundary method")
396396

397-
self._axes_class_floating.__init__(self, *kl, **kwargs)
397+
self._axes_class_floating.__init__(self, *args, **kwargs)
398398

399399
self.set_aspect(1.)
400400
self.adjust_axes_lim()

0 commit comments

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