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 e76c94e

Browse filesBrowse files
committed
Fix pydocstyle D208
1 parent efafb6c commit e76c94e
Copy full SHA for e76c94e

File tree

Expand file treeCollapse file tree

12 files changed

+85
-59
lines changed
Filter options
Expand file treeCollapse file tree

12 files changed

+85
-59
lines changed

‎.flake8

Copy file name to clipboardExpand all lines: .flake8
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ignore =
1212
N801, N802, N803, N806, N812,
1313
# pydocstyle
1414
D100, D101, D102, D103, D104, D105, D106, D107,
15-
D200, D202, D203, D204, D205, D207, D208, D209, D212, D213,
15+
D200, D202, D203, D204, D205, D207, D209, D212, D213,
1616
D300, D301
1717
D400, D401, D402, D403, D413,
1818

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,23 +1249,24 @@ def get_backend():
12491249

12501250
def interactive(b):
12511251
"""
1252-
Set interactive mode to boolean b.
1253-
1254-
If b is True, then draw after every plotting command, e.g., after xlabel
1252+
Set whether to redraw after every plotting command (e.g. `.pyplot.xlabel`).
12551253
"""
12561254
rcParams['interactive'] = b
12571255

12581256

12591257
def is_interactive():
1260-
'Return true if plot mode is interactive'
1258+
"""Return whether to redraw after every plotting command."""
12611259
return rcParams['interactive']
12621260

12631261

12641262
@cbook.deprecated("3.1", alternative="rcParams['tk.window_focus']")
12651263
def tk_window_focus():
1266-
"""Return true if focus maintenance under TkAgg on win32 is on.
1267-
This currently works only for python.exe and IPython.exe.
1268-
Both IDLE and Pythonwin.exe fail badly when tk_window_focus is on."""
1264+
"""
1265+
Return true if focus maintenance under TkAgg on win32 is on.
1266+
1267+
This currently works only for python.exe and IPython.exe.
1268+
Both IDLE and Pythonwin.exe fail badly when tk_window_focus is on.
1269+
"""
12691270
if rcParams['backend'] != 'TkAgg':
12701271
return False
12711272
return rcParams['tk.window_focus']

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,16 +613,16 @@ def set_bad(self, color='k', alpha=None):
613613
self._set_extremes()
614614

615615
def set_under(self, color='k', alpha=None):
616-
"""Set color to be used for low out-of-range values.
617-
Requires norm.clip = False
616+
"""
617+
Set the color for low out-of-range values when ``norm.clip = False``.
618618
"""
619619
self._rgba_under = to_rgba(color, alpha)
620620
if self._isinit:
621621
self._set_extremes()
622622

623623
def set_over(self, color='k', alpha=None):
624-
"""Set color to be used for high out-of-range values.
625-
Requires norm.clip = False
624+
"""
625+
Set the color for high out-of-range values when ``norm.clip = False``.
626626
"""
627627
self._rgba_over = to_rgba(color, alpha)
628628
if self._isinit:

‎lib/matplotlib/dates.py

Copy file name to clipboardExpand all lines: lib/matplotlib/dates.py
+25-10Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,22 @@ class strpdate2num:
321321
you know the date format string of the date you are parsing.
322322
"""
323323
def __init__(self, fmt):
324-
"""fmt: any valid strptime format is supported"""
324+
"""
325+
Parameters
326+
----------
327+
fmt : any valid strptime format
328+
"""
325329
self.fmt = fmt
326330

327331
def __call__(self, s):
328-
"""s : string to be converted
329-
return value: a date2num float
332+
"""
333+
Parameters
334+
----------
335+
s : str
336+
337+
Returns
338+
-------
339+
date2num float
330340
"""
331341
return date2num(datetime.datetime(*time.strptime(s, self.fmt)[:6]))
332342

@@ -341,19 +351,24 @@ class bytespdate2num(strpdate2num):
341351
"""
342352
def __init__(self, fmt, encoding='utf-8'):
343353
"""
344-
Args:
345-
fmt: any valid strptime format is supported
346-
encoding: encoding to use on byte input (default: 'utf-8')
354+
Parameters
355+
----------
356+
fmt : any valid strptime format
357+
encoding : str
358+
Encoding to use on byte input.
347359
"""
348360
super().__init__(fmt)
349361
self.encoding = encoding
350362

351363
def __call__(self, b):
352364
"""
353-
Args:
354-
b: byte input to be converted
355-
Returns:
356-
A date2num float
365+
Parameters
366+
----------
367+
b : bytes
368+
369+
Returns
370+
-------
371+
date2num float
357372
"""
358373
s = b.decode(self.encoding)
359374
return super().__call__(s)

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+17-11Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,13 @@ def get_path(self):
709709
return Path.unit_rectangle()
710710

711711
def _update_patch_transform(self):
712-
"""NOTE: This cannot be called until after this has been added
713-
to an Axes, otherwise unit conversion will fail. This
714-
makes it very important to call the accessor method and
715-
not directly access the transformation member variable.
712+
"""
713+
Notes
714+
-----
715+
This cannot be called until after this has been added to an Axes,
716+
otherwise unit conversion will fail. This makes it very important to
717+
call the accessor method and not directly access the transformation
718+
member variable.
716719
"""
717720
x0, y0, x1, y1 = self._convert_units()
718721
bbox = transforms.Bbox.from_extents(x0, y0, x1, y1)
@@ -1364,10 +1367,13 @@ def __init__(self, xy, width, height, angle=0, **kwargs):
13641367
self._patch_transform = transforms.IdentityTransform()
13651368

13661369
def _recompute_transform(self):
1367-
"""NOTE: This cannot be called until after this has been added
1368-
to an Axes, otherwise unit conversion will fail. This
1369-
makes it very important to call the accessor method and
1370-
not directly access the transformation member variable.
1370+
"""
1371+
Notes
1372+
-----
1373+
This cannot be called until after this has been added to an Axes,
1374+
otherwise unit conversion will fail. This makes it very important to
1375+
call the accessor method and not directly access the transformation
1376+
member variable.
13711377
"""
13721378
center = (self.convert_xunits(self._center[0]),
13731379
self.convert_yunits(self._center[1]))
@@ -1941,10 +1947,10 @@ class Square(_Base):
19411947

19421948
def __init__(self, pad=0.3):
19431949
"""
1944-
*pad*
1945-
amount of padding
1950+
Parameters
1951+
----------
1952+
pad : float
19461953
"""
1947-
19481954
self.pad = pad
19491955
super().__init__()
19501956

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def show(*args, **kw):
272272

273273

274274
def isinteractive():
275-
"""Return the status of interactive mode."""
275+
"""Return whether to redraw after every plotting command."""
276276
return matplotlib.is_interactive()
277277

278278

@@ -1007,7 +1007,7 @@ def subplot(*args, **kwargs):
10071007
10081008
# add ax2 to the figure again
10091009
plt.subplot(ax2)
1010-
"""
1010+
"""
10111011

10121012
# if subplot called without arguments, create subplot(1,1,1)
10131013
if len(args) == 0:

‎lib/matplotlib/spines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/spines.py
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ def set_patch_line(self):
124124

125125
# Behavior copied from mpatches.Ellipse:
126126
def _recompute_transform(self):
127-
"""NOTE: This cannot be called until after this has been added
128-
to an Axes, otherwise unit conversion will fail. This
129-
makes it very important to call the accessor method and
130-
not directly access the transformation member variable.
127+
"""
128+
Notes
129+
-----
130+
This cannot be called until after this has been added to an Axes,
131+
otherwise unit conversion will fail. This makes it very important to
132+
call the accessor method and not directly access the transformation
133+
member variable.
131134
"""
132135
assert self._patch_type in ('arc', 'circle')
133136
center = (self.convert_xunits(self._center[0]),

‎lib/matplotlib/testing/jpl_units/EpochConverter.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/jpl_units/EpochConverter.py
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010

1111

1212
class EpochConverter(units.ConversionInterface):
13-
""": A matplotlib converter class. Provides matplotlib conversion
14-
functionality for Monte Epoch and Duration classes.
13+
"""
14+
Provides Matplotlib conversion functionality for Monte Epoch and Duration
15+
classes.
1516
"""
1617

1718
# julian date reference for "Jan 1, 0001" minus 1 day because
18-
# matplotlib really wants "Jan 0, 0001"
19+
# Matplotlib really wants "Jan 0, 0001"
1920
jdRef = 1721425.5 - 1
2021

2122
@staticmethod
@@ -26,7 +27,7 @@ def axisinfo(unit, axis):
2627
- unit The units to use for a axis with Epoch data.
2728
2829
= RETURN VALUE
29-
- Returns a matplotlib AxisInfo data structure that contains
30+
- Returns a AxisInfo data structure that contains
3031
minor/major formatters, major/minor locators, and default
3132
label information.
3233
"""
@@ -38,11 +39,11 @@ def axisinfo(unit, axis):
3839

3940
@staticmethod
4041
def float2epoch(value, unit):
41-
""": Convert a matplotlib floating-point date into an Epoch of the
42+
""": Convert a Matplotlib floating-point date into an Epoch of the
4243
specified units.
4344
4445
= INPUT VARIABLES
45-
- value The matplotlib floating-point date.
46+
- value The Matplotlib floating-point date.
4647
- unit The unit system to use for the Epoch.
4748
4849
= RETURN VALUE

‎lib/matplotlib/testing/jpl_units/UnitDblConverter.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/jpl_units/UnitDblConverter.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def rad_fn(x, pos=None):
2828

2929

3030
class UnitDblConverter(units.ConversionInterface):
31-
""": A matplotlib converter class. Provides matplotlib conversion
32-
functionality for the Monte UnitDbl class.
31+
"""
32+
Provides Matplotlib conversion functionality for the Monte UnitDbl class.
3333
"""
3434
# default for plotting
3535
defaults = {

‎lib/matplotlib/testing/jpl_units/UnitDblFormatter.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/jpl_units/UnitDblFormatter.py
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,23 @@
66

77

88
class UnitDblFormatter(ticker.ScalarFormatter):
9-
"""The formatter for UnitDbl data types. This allows for formatting
10-
with the unit string.
119
"""
12-
def __init__(self, *args, **kwargs):
13-
'The arguments are identical to matplotlib.ticker.ScalarFormatter.'
14-
ticker.ScalarFormatter.__init__(self, *args, **kwargs)
10+
The formatter for UnitDbl data types.
11+
12+
This allows for formatting with the unit string.
13+
"""
1514

1615
def __call__(self, x, pos=None):
17-
'Return the format for tick val x at position pos'
16+
# docstring inherited
1817
if len(self.locs) == 0:
1918
return ''
2019
else:
2120
return '{:.12}'.format(x)
2221

2322
def format_data_short(self, value):
24-
"Return the value formatted in 'short' format."
23+
# docstring inherited
2524
return '{:.12}'.format(value)
2625

2726
def format_data(self, value):
28-
"Return the value formatted into a string."
27+
# docstring inherited
2928
return '{:.12}'.format(value)

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,8 +1512,7 @@ def __call__(self):
15121512
raise NotImplementedError('Derived must override')
15131513

15141514
def raise_if_exceeds(self, locs):
1515-
"""raise a RuntimeError if Locator attempts to create more than
1516-
MAXTICKS locs"""
1515+
"""Raise a RuntimeError if ``len(locs) > self.MAXTICKS``."""
15171516
if len(locs) >= self.MAXTICKS:
15181517
raise RuntimeError("Locator attempting to generate {} ticks from "
15191518
"{} to {}: exceeds Locator.MAXTICKS".format(

‎lib/mpl_toolkits/axisartist/axisline_style.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axisline_style.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ class SimpleArrow(_Base):
135135

136136
def __init__(self, size=1):
137137
"""
138-
*size*
139-
size of the arrow as a fraction of the ticklabel size.
138+
Parameters
139+
----------
140+
size : float
141+
Size of the arrow as a fraction of the ticklabel size.
140142
"""
141143

142144
self.size = size

0 commit comments

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