Skip to content

Commit 717d1fa

Browse files
authored
Merge pull request matplotlib#17125 from anntzer/multidoc
Make multiline docstrings start with a newline.
2 parents 533bb57 + 45f6107 commit 717d1fa

30 files changed

+156
-185
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ignore =
1313
N801, N802, N803, N806, N812,
1414
# pydocstyle
1515
D100, D101, D102, D103, D104, D105, D106, D107,
16-
D200, D202, D203, D204, D205, D207, D212, D213,
16+
D200, D202, D203, D204, D205, D207, D212,
1717
D301
1818
D400, D401, D402, D403, D413,
1919

lib/matplotlib/animation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def correct_roundoff(x, dpi, n):
9393
return correct_roundoff(wnew, dpi, n), correct_roundoff(hnew, dpi, n)
9494

9595

96-
# A registry for available MovieWriter classes
9796
class MovieWriterRegistry:
9897
"""Registry of available writer classes by human readable name."""
98+
9999
def __init__(self):
100100
self._registered = dict()
101101

@@ -104,7 +104,8 @@ def set_dirty(self):
104104
"""Sets a flag to re-setup the writers."""
105105

106106
def register(self, name):
107-
"""Decorator for registering a class under a name.
107+
"""
108+
Decorator for registering a class under a name.
108109
109110
Example use::
110111
@@ -564,7 +565,8 @@ def finish(self):
564565
# Base class of ffmpeg information. Has the config keys and the common set
565566
# of arguments that controls the *output* side of things.
566567
class FFMpegBase:
567-
"""Mixin class for FFMpeg output.
568+
"""
569+
Mixin class for FFMpeg output.
568570
569571
To be useful this must be multiply-inherited from with a
570572
`MovieWriterBase` sub-class.
@@ -606,7 +608,8 @@ def isAvailable(cls):
606608
# Combine FFMpeg options with pipe-based writing
607609
@writers.register('ffmpeg')
608610
class FFMpegWriter(FFMpegBase, MovieWriter):
609-
"""Pipe-based ffmpeg writer.
611+
"""
612+
Pipe-based ffmpeg writer.
610613
611614
Frames are streamed directly to ffmpeg via a pipe and written in a single
612615
pass.

lib/matplotlib/artist.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
669669
self.stale = True
670670

671671
def set_path_effects(self, path_effects):
672-
"""Set the path effects.
672+
"""
673+
Set the path effects.
673674
674675
Parameters
675676
----------
@@ -883,7 +884,8 @@ def get_agg_filter(self):
883884
return self._agg_filter
884885

885886
def set_agg_filter(self, filter_func):
886-
"""Set the agg filter.
887+
"""
888+
Set the agg filter.
887889
888890
Parameters
889891
----------

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7834,7 +7834,8 @@ def _kde_method(X, coords):
78347834

78357835
def violin(self, vpstats, positions=None, vert=True, widths=0.5,
78367836
showmeans=False, showextrema=True, showmedians=False):
7837-
"""Drawing function for violin plots.
7837+
"""
7838+
Drawing function for violin plots.
78387839
78397840
Draw a violin plot for each column of *vpstats*. Each filled area
78407841
extends to represent the entire data range, with optional lines at the

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,8 @@ def locator_params(self, axis='both', tight=None, **kwargs):
30223022
scalex=update_x, scaley=update_y)
30233023

30243024
def tick_params(self, axis='both', **kwargs):
3025-
"""Change the appearance of ticks, tick labels, and gridlines.
3025+
"""
3026+
Change the appearance of ticks, tick labels, and gridlines.
30263027
30273028
Tick properties that are not explicitly set using the keyword
30283029
arguments remain unchanged unless *reset* is True.

lib/matplotlib/axis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,8 +1885,7 @@ def __init__(self, *args, **kwargs):
18851885
self.offset_text_position = 'bottom'
18861886

18871887
def contains(self, mouseevent):
1888-
"""Test whether the mouse event occurred in the x axis.
1889-
"""
1888+
"""Test whether the mouse event occurred in the x axis."""
18901889
inside, info = self._default_contains(mouseevent)
18911890
if inside is not None:
18921891
return inside, info

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def get_registered_canvas_class(format):
116116

117117

118118
class RendererBase:
119-
"""An abstract base class to handle drawing/rendering operations.
119+
"""
120+
An abstract base class to handle drawing/rendering operations.
120121
121122
The following methods must be implemented in the backend for full
122123
functionality (though just implementing :meth:`draw_path` alone would

lib/matplotlib/backends/_backend_tk.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ def idle_draw(*args):
260260
self._idle_callback = self._tkcanvas.after_idle(idle_draw)
261261

262262
def get_tk_widget(self):
263-
"""Return the Tk widget used to implement FigureCanvasTkAgg.
263+
"""
264+
Return the Tk widget used to implement FigureCanvasTkAgg.
265+
264266
Although the initial implementation uses a Tk canvas, this routine
265267
is intended to hide that fact.
266268
"""

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def _render_figure(self, width, height):
2424
backend_agg.FigureCanvasAgg.draw(self)
2525

2626
def on_draw_event(self, widget, ctx):
27-
"""GtkDrawable draw event, like expose_event in GTK 2.X.
28-
"""
27+
"""GtkDrawable draw event, like expose_event in GTK 2.X."""
2928
allocation = self.get_allocation()
3029
w, h = allocation.width, allocation.height
3130

lib/matplotlib/backends/backend_pdf.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ def pdfRepr(obj):
226226

227227

228228
class Reference:
229-
"""PDF reference object.
229+
"""
230+
PDF reference object.
231+
230232
Use PdfFile.reserveObject() to create References.
231233
"""
232234

@@ -1223,7 +1225,8 @@ def alphaState(self, alpha):
12231225
return name
12241226

12251227
def _soft_mask_state(self, smask):
1226-
"""Return an ExtGState that sets the soft mask to the given shading.
1228+
"""
1229+
Return an ExtGState that sets the soft mask to the given shading.
12271230
12281231
Parameters
12291232
----------
@@ -1345,7 +1348,8 @@ def writeHatches(self):
13451348
self.writeObject(self.hatchObject, hatchDict)
13461349

13471350
def addGouraudTriangles(self, points, colors):
1348-
"""Add a Gouraud triangle shading
1351+
"""
1352+
Add a Gouraud triangle shading.
13491353
13501354
Parameters
13511355
----------
@@ -1603,11 +1607,12 @@ def writePath(self, path, transform, clip=False, sketch=None):
16031607
self.output(*cmds)
16041608

16051609
def reserveObject(self, name=''):
1606-
"""Reserve an ID for an indirect object.
1610+
"""
1611+
Reserve an ID for an indirect object.
1612+
16071613
The name is used for debugging in case we forget to print out
16081614
the object with writeObject.
16091615
"""
1610-
16111616
id = next(self._object_seq)
16121617
self.xrefTable.append([None, 0, name])
16131618
return Reference(id)

0 commit comments

Comments
 (0)