8000 Enforce pydocstyle D412 by timhoffm · Pull Request #14336 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Enforce pydocstyle D412 #14336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ignore =
D100, D101, D102, D103, D104, D105, D106, D107,
D200, D202, D203, D204, D205, D207, D208, D209, D212, D213,
D300, D301
D400, D401, D402, D403, D412, D413,
D400, D401, D402, D403, D413,

exclude =
.git
Expand Down
31 changes: 19 additions & 12 deletions examples/text_labels_and_annotations/arrow_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,25 @@ def make_arrow_plot(data, size=4, display='length', shape='right',
**kwargs):
"""Makes an arrow plot.

Parameters:

data: dict with probabilities for the bases and pair transitions.
size: size of the graph in inches.
display: 'length', 'width', or 'alpha' for arrow property to change.
shape: 'full', 'left', or 'right' for full or half arrows.
max_arrow_width: maximum width of an arrow, data coordinates.
arrow_sep: separation between arrows in a pair, data coordinates.
alpha: maximum opacity of arrows, default 0.8.

**kwargs can be anything allowed by a Arrow object, e.g.
linewidth and edgecolor.
Parameters
----------
data
Dict with probabilities for the bases and pair transitions.
size
Size of the graph in inches.
display : {'length', 'width', 'alpha'}
The arrow property to change.
shape : {'full', 'left', 'right'}
For full or half arrows.
max_arrow_width : float
Maximum width of an arrow, data coordinates.
arrow_sep : float
Separation between arrows in a pair, data coordinates.
alpha : float
Maximum opacity of arrows.
**kwargs
Can be anything allowed by a Arrow object, e.g. *linewidth* or
*edgecolor*.
"""

plt.xlim(-0.5, 1.5)
Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/_constrained_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def do_constrained_layout(fig, renderer, h_pad, w_pad,

Parameters
----------


fig : Figure
is the ``figure`` instance to do the layout in.

Expand Down
9 changes: 4 additions & 5 deletions lib/matplotlib/_pylab_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ class Gcf:
methods that operate on those attributes, accessing them
directly as class attributes.

Attributes:

*figs*:
Attributes
----------
figs
dictionary of the form {*num*: *manager*, ...}

*_activeQue*:
_activeQue
list of *managers*, with active one at the end

"""
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,

Parameters
----------

filename : str
The output filename, e.g., :file:`mymovie.mp4`.

Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):

Parameters
----------

scale : float, optional
The amplitude of the wiggle perpendicular to the source
line, in pixels. If scale is `None`, or not provided, no
Expand Down Expand Up @@ -1018,7 +1017,6 @@ def sticky_edges(self):

Examples
--------

>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)

Expand Down
28 changes: 0 additions & 28 deletions lib/matplotlib/axes/_axes.py
F42D
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ def legend(self, *args, **kwargs):

Parameters
----------

handles : sequence of `.Artist`, optional
A list of Artists (lines, patches) to be added to the legend.
Use this together with *labels*, if you need full control on what
Expand All @@ -376,7 +375,6 @@ def legend(self, *args, **kwargs):

Other Parameters
----------------

%(_legend_kw_doc)s

Returns
Expand All @@ -385,13 +383,11 @@ def legend(self, *args, **kwargs):

Notes
-----

Not all kinds of artist are supported by the legend command. See
:doc:`/tutorials/intermediate/legend_guide` for details.

Examples
--------

.. plot:: gallery/text_labels_and_annotations/legend.py
"""
handles, labels, extra_args, kwargs = mlegend._parse_legend_args(
Expand All @@ -414,12 +410,10 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,

Warnings
--------

This method is experimental as of 3.0, and the API may change.

Parameters
----------

bounds : [x0, y0, width, height]
Lower-left corner of inset axes, and its width and height.

Expand All @@ -438,13 +432,11 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,

Returns
-------

Axes
The created `.axes.Axes` instance.

Examples
--------

This example makes two inset axes, the first is in axes-relative
coordinates, and the second in data-coordinates::

Expand Down Expand Up @@ -485,13 +477,11 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,

Warnings
--------

This method is experimental as of 3.0, and the API may change.


Parameters
----------

bounds : [x0, y0, width, height]
Lower-left corner of rectangle to be marked, and its width
and height.
Expand Down Expand Up @@ -525,7 +515,6 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,

Returns
-------

rectangle_patch : `.Patches.Rectangle`
Rectangle artist.

Expand Down Expand Up @@ -588,12 +577,10 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):

Warnings
--------

This method is experimental as of 3.0, and the API may change.

Parameters
----------

inset_ax : `.Axes`
Inset axes to draw connecting lines to. Two lines are
drawn connecting the indicator box to the inset axes on corners
Expand All @@ -604,7 +591,6 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):

Returns
-------

rectangle_patch : `.Patches.Rectangle`
Rectangle artist.

Expand Down Expand Up @@ -635,7 +621,6 @@ def secondary_xaxis(self, location, *, functions=None, **kwargs):

Examples
--------

The main axis shows frequency, and the secondary axis shows period.

.. plot::
Expand Down Expand Up @@ -671,7 +656,6 @@ def secondary_yaxis(self, location, *, functions=None, **kwargs):

Examples
--------

Add a secondary axes that converts from radians to degrees

.. plot::
Expand Down Expand Up @@ -827,7 +811,6 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):

Examples
--------

* draw a thick red hline at 'y' = 0 that spans the xrange::

>>> axhline(linewidth=4, color='r')
Expand Down Expand Up @@ -1272,22 +1255,19 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,

Returns
-------

list : A list of :class:`~.collections.EventCollection` objects.
Contains the :class:`~.collections.EventCollection` that
were added.

Notes
-----

For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only
a single value is given, that value is applied to all lines. If an
array-like is given, it must have the same length as *positions*, and
each value will be applied to the corresponding row of the array.

Examples
--------

.. plot:: gallery/lines_bars_and_markers/eventplot_demo.py
"""
self._process_unit_info(xdata=positions,
Expand Down Expand Up @@ -2738,7 +2718,6 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,

Notes
-----

.. seealso::
The MATLAB function
`stem <http://www.mathworks.com/help/techdoc/ref/stem.html>`_
Expand Down Expand Up @@ -3787,7 +3766,6 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,

Parameters
----------

bxpstats : list of dicts
A list of dictionaries containing stats for each boxplot.
Required keys are:
Expand Down Expand Up @@ -3913,7 +3891,6 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,

Examples
--------

.. plot:: gallery/statistics/bxp.py

"""
Expand Down Expand Up @@ -4397,7 +4374,6 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,

Notes
-----

* The `.plot` function will be faster for scatterplots where markers
don't vary in size or color.

Expand Down Expand Up @@ -5821,7 +5797,6 @@ def pcolor(self, *args, alpha=None, norm=None, cmap=None, vmin=None,

Notes
-----

**Masked arrays**

*X*, *Y* and *C* may be masked arrays. If either ``C[i, j]``, or one
Expand Down Expand Up @@ -6058,7 +6033,6 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,

Notes
-----

**Masked arrays**

*C* may be a masked array. If ``C[i, j]`` is masked, the corresponding
Expand Down Expand Up @@ -7919,7 +7893,6 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,

Returns
-------

result : dict
A dictionary mapping each component of the violinplot to a
list of the corresponding collection instances created. The
Expand Down Expand Up @@ -7972,7 +7945,6 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,

Parameters
----------

vpstats : list of dicts
A list of dictionaries containing stats for each violin plot.
Required keys are:
Expand Down
3 changes: 0 additions & 3 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,6 @@ def tick_params(self, axis='both', **kwargs):

Other Parameters
----------------

axis : {'x', 'y', 'both'}
Axis on which to operate; default is 'both'.

Expand Down Expand Up @@ -2995,7 +2994,6 @@ def tick_params(self, axis='both', **kwargs):

Examples
--------

Usage ::

ax.tick_params(direction='out', length=6, width=2, colors='r',
Expand Down Expand Up @@ -3990,7 +3988,6 @@ def _set_view_from_bbox(self, bbox, direction='in',

Parameters
----------

bbox : 4-tuple or 3 tuple
* If bbox is a 4 tuple, it is the selected bounding box limits,
in *display* coordinates.
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/axes/_secondary_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ def set_color(self, color):
_secax_docstring = '''
Warnings
--------

This method is experimental as of 3.1, and the API may change.

Parameters
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,6 @@ def new_timer(self, *args, **kwargs):

Examples
--------

>>> timer = fig.canvas.new_timer(callbacks=[(f1, (1, ), {'a': 3}),])

"""
Expand Down
4 changes: 0 additions & 4 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,6 @@ class PdfPages:

Examples
--------

>>> import matplotlib.pyplot as plt
>>> # Initialize:
>>> with PdfPages('foo.pdf') as pdf:
Expand All @@ -2342,7 +2341,6 @@ class PdfPages:

Notes
-----

In reality :class:`PdfPages` is a thin wrapper around :class:`PdfFile`, in
order to avoid confusion when using :func:`~matplotlib.pyplot.savefig` and
forgetting the format argument.
Expand All @@ -2355,7 +2353,6 @@ def __init__(self, filename, keep_empty=True, metadata=None):

Parameters
----------

filename : str
Plots using :meth:`PdfPages.savefig` will be written to a file at
this location. The file is opened at once and any older file with
Expand Down Expand Up @@ -2414,7 +2411,6 @@ def savefig(self, figure=None, **kwargs):

Parameters
----------

figure : :class:`~matplotlib.figure.Figure` or int, optional
Specifies what figure is saved to file. If not specified, the
active figure is saved. If a :class:`~matplotlib.figure.Figure`
Expand Down
Loading
0