Skip to content

Commit 03ceef7

Browse files
committed
Merge pull request #3548 from jenshnielsen/autodoc_fixes
Silence some Sphinx warnings by rewriting docstrings.
2 parents 33a8a76 + 2f1fcde commit 03ceef7

File tree

7 files changed

+62
-32
lines changed

7 files changed

+62
-32
lines changed

lib/matplotlib/axes/_axes.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):
124124
125125
Other parameters
126126
----------------
127-
Other keyword arguments are text properties, see
128-
:class:`~matplotlib.text.Text` for a list of valid text
129-
properties.
127+
kwargs : text properties
128+
Other keyword arguments are text properties, see
129+
:class:`~matplotlib.text.Text` for a list of valid text
130+
properties.
130131
"""
131132
try:
132133
title = {'left': self._left_title,
@@ -3021,10 +3022,11 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
30213022
Returns
30223023
-------
30233024
3024-
A dictionary mapping each component of the boxplot
3025-
to a list of the :class:`matplotlib.lines.Line2D`
3026-
instances created. That dictionary has the following keys
3027-
(assuming vertical boxplots):
3025+
result : dict
3026+
A dictionary mapping each component of the boxplot
3027+
to a list of the :class:`matplotlib.lines.Line2D`
3028+
instances created. That dictionary has the following keys
3029+
(assuming vertical boxplots):
30283030
30293031
- boxes: the main body of the boxplot showing the quartiles
30303032
and the median's confidence intervals if enabled.
@@ -5032,6 +5034,7 @@ def pcolormesh(self, *args, **kwargs):
50325034
50335035
*edgecolors*: [*None* | ``'None'`` | ``'face'`` | color |
50345036
color sequence]
5037+
50355038
If *None*, the rc setting is used by default.
50365039
50375040
If ``'None'``, edges will not be visible.

lib/matplotlib/cbook.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ def new_function():
122122
123123
Examples
124124
--------
125-
# To warn of the deprecation of "matplotlib.name_of_module"
126-
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
127-
obj_type='module')
125+
126+
Basic example::
127+
128+
# To warn of the deprecation of "matplotlib.name_of_module"
129+
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
130+
obj_type='module')
128131
129132
"""
130133
message = _generate_deprecation_message(
@@ -174,9 +177,12 @@ def new_function():
174177
175178
Examples
176179
--------
177-
@deprecated('1.4.0')
178-
def the_function_to_deprecate():
179-
pass
180+
181+
Basic example::
182+
183+
@deprecated('1.4.0')
184+
def the_function_to_deprecate():
185+
pass
180186
181187
"""
182188
def deprecate(func, message=message, name=name, alternative=alternative,
@@ -1911,7 +1917,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None):
19111917
19121918
General approach from:
19131919
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
1914-
Boxplots", The American Statistician, 32:12-16.
1920+
Boxplots", The American Statistician, 32:12-16.
19151921
19161922
'''
19171923

lib/matplotlib/lines.py

+1
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ def set_linestyle(self, linestyle):
937937
938938
ACCEPTS: [``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` |
939939
``' '`` | ``''``]
940+
940941
and any drawstyle in combination with a linestyle, e.g., ``'steps--'``.
941942
"""
942943

lib/matplotlib/mlab.py

+19-7
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ def demean(x, axis=0):
394394
.. seealso::
395395
396396
:func:`delinear`
397+
397398
:func:`denone`
398399
:func:`delinear` and :func:`denone` are other detrend algorithms.
399400
@@ -427,6 +428,7 @@ def detrend_mean(x, axis=None):
427428
for the default *axis*.
428429
429430
:func:`detrend_linear`
431+
430432
:func:`detrend_none`
431433
:func:`detrend_linear` and :func:`detrend_none` are other
432434
detrend algorithms.
@@ -474,6 +476,7 @@ def detrend_none(x, axis=None):
474476
for the default *axis*, which has no effect.
475477
476478
:func:`detrend_mean`
479+
477480
:func:`detrend_linear`
478481
:func:`detrend_mean` and :func:`detrend_linear` are other
479482
detrend algorithms.
@@ -506,6 +509,7 @@ def detrend_linear(y):
506509
for the default *axis*.
507510
508511
:func:`detrend_mean`
512+
509513
:func:`detrend_none`
510514
:func:`detrend_mean` and :func:`detrend_none` are other
511515
detrend algorithms.
@@ -537,9 +541,11 @@ def stride_windows(x, n, noverlap=None, axis=0):
537541
Get all windows of x with length n as a single array,
538542
using strides to avoid data duplication.
539543
540-
.. warning:: It is not safe to write to the output array. Multiple
541-
elements may point to the same piece of memory, so modifying one value may
542-
change others.
544+
.. warning::
545+
546+
It is not safe to write to the output array. Multiple
547+
elements may point to the same piece of memory,
548+
so modifying one value may change others.
543549
544550
Call signature::
545551
@@ -599,9 +605,11 @@ def stride_repeat(x, n, axis=0):
599605
Repeat the values in an array in a memory-efficient manner. Array x is
600606
stacked vertically n times.
601607
602-
.. warning:: It is not safe to write to the output array. Multiple
603-
elements may point to the same piece of memory, so modifying one value may
604-
change others.
608+
.. warning::
609+
610+
It is not safe to write to the output array. Multiple
611+
elements may point to the same piece of memory, so
612+
modifying one value may change others.
605613
606614
Call signature::
607615
@@ -878,6 +886,7 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,
878886
879887
*detrend*: [ 'default' | 'constant' | 'mean' | 'linear' | 'none'] or
880888
callable
889+
881890
The function applied to each segment before fft-ing,
882891
designed to remove the mean or linear trend. Unlike in
883892
MATLAB, where the *detrend* parameter is a vector, in
@@ -1244,6 +1253,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
12441253
12451254
*mode*: [ 'default' | 'psd' | 'complex' | 'magnitude'
12461255
'angle' | 'phase' ]
1256+
12471257
What sort of spectrum to use. Default is 'psd'. which takes the
12481258
power spectral density. 'complex' returns the complex-valued
12491259
frequency spectrum. 'magnitude' returns the magnitude spectrum.
@@ -1599,7 +1609,9 @@ def longest_ones(x):
15991609
def prepca(P, frac=0):
16001610
"""
16011611
1602-
WARNING: this function is deprecated -- please see class PCA instead
1612+
.. warning::
1613+
1614+
This function is deprecated -- please see class PCA instead
16031615
16041616
Compute the principal components of *P*. *P* is a (*numVars*,
16051617
*numObs*) array. *frac* is the minimum fraction of variance that a

lib/matplotlib/pyplot.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -1311,17 +1311,24 @@ def title(s, *args, **kwargs):
13111311
positioned above the axes in the center, flush with the left edge,
13121312
and flush with the right edge.
13131313
1314+
.. seealso::
1315+
See :func:`~matplotlib.pyplot.text` for adding text
1316+
to the current axes
1317+
13141318
Parameters
13151319
----------
13161320
label : str
13171321
Text to use for the title
1322+
13181323
fontdict : dict
13191324
A dictionary controlling the appearance of the title text,
13201325
the default `fontdict` is:
1321-
{'fontsize': rcParams['axes.titlesize'],
1322-
'fontweight' : rcParams['axes.titleweight'],
1323-
'verticalalignment': 'baseline',
1324-
'horizontalalignment': loc}
1326+
1327+
{'fontsize': rcParams['axes.titlesize'],
1328+
'fontweight' : rcParams['axes.titleweight'],
1329+
'verticalalignment': 'baseline',
1330+
'horizontalalignment': loc}
1331+
13251332
loc : {'center', 'left', 'right'}, str, optional
13261333
Which title to set, defaults to 'center'
13271334
@@ -1332,13 +1339,10 @@ def title(s, *args, **kwargs):
13321339
13331340
Other parameters
13341341
----------------
1335-
Other keyword arguments are text properties, see
1336-
:class:`~matplotlib.text.Text` for a list of valid text
1337-
properties.
1338-
1339-
See also
1340-
--------
1341-
See :func:`~matplotlib.pyplot.text` for adding text to the current axes
1342+
kwargs : text properties
1343+
Other keyword arguments are text properties, see
1344+
:class:`~matplotlib.text.Text` for a list of valid text
1345+
properties.
13421346
13431347
"""
13441348
l = gca().set_title(s, *args, **kwargs)

lib/matplotlib/tri/trirefine.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class TriRefiner(object):
3737
:class:`~matplotlib.tri.TriInterpolator` (optional)
3838
- the other optional keyword arguments *kwargs* are defined in
3939
each TriRefiner concrete implementation
40+
4041
and which returns (as a tuple) a refined triangular mesh and the
4142
interpolated values of the field at the refined triangulation nodes.
4243

lib/mpl_toolkits/mplot3d/art3d.py

+3
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,12 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
436436
:class:`Path3DCollection` object).
437437
438438
Keywords:
439+
439440
*za* The location or locations to place the patches in the
440441
collection along the *zdir* axis. Defaults to 0.
442+
441443
*zdir* The axis in which to place the patches. Default is "z".
444+
442445
*depthshade* Whether to shade the patches to give a sense of depth.
443446
Defaults to *True*.
444447

0 commit comments

Comments
 (0)