Skip to content
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

Silence some Sphinx warnings by rewriting docstrings. #3548

Merged
merged 8 commits into from
Sep 22, 2014
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
17 changes: 10 additions & 7 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):

Other parameters
----------------
Other keyword arguments are text properties, see
:class:`~matplotlib.text.Text` for a list of valid text
properties.
kwargs : text properties
Other keyword arguments are text properties, see
:class:`~matplotlib.text.Text` for a list of valid text
properties.
"""
try:
title = {'left': self._left_title,
Expand Down Expand Up @@ -3021,10 +3022,11 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
Returns
-------

A dictionary mapping each component of the boxplot
to a list of the :class:`matplotlib.lines.Line2D`
instances created. That dictionary has the following keys
(assuming vertical boxplots):
result : dict
A dictionary mapping each component of the boxplot
to a list of the :class:`matplotlib.lines.Line2D`
instances created. That dictionary has the following keys
(assuming vertical boxplots):

- boxes: the main body of the boxplot showing the quartiles
and the median's confidence intervals if enabled.
Expand Down Expand Up @@ -5032,6 +5034,7 @@ def pcolormesh(self, *args, **kwargs):

*edgecolors*: [*None* | ``'None'`` | ``'face'`` | color |
color sequence]

If *None*, the rc setting is used by default.

If ``'None'``, edges will not be visible.
Expand Down
20 changes: 13 additions & 7 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ def new_function():

Examples
--------
# To warn of the deprecation of "matplotlib.name_of_module"
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
obj_type='module')

Basic example::

# To warn of the deprecation of "matplotlib.name_of_module"
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
obj_type='module')

"""
message = _generate_deprecation_message(
Expand Down Expand Up @@ -174,9 +177,12 @@ def new_function():

Examples
--------
@deprecated('1.4.0')
def the_function_to_deprecate():
pass

Basic example::

@deprecated('1.4.0')
def the_function_to_deprecate():
pass

"""
def deprecate(func, message=message, name=name, alternative=alternative,
Expand Down Expand Up @@ -1911,7 +1917,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None):

General approach from:
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
Boxplots", The American Statistician, 32:12-16.
Boxplots", The American Statistician, 32:12-16.

'''

Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ def set_linestyle(self, linestyle):

ACCEPTS: [``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` |
``' '`` | ``''``]

and any drawstyle in combination with a linestyle, e.g., ``'steps--'``.
"""

Expand Down
26 changes: 19 additions & 7 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ def demean(x, axis=0):
.. seealso::

:func:`delinear`

:func:`denone`
:func:`delinear` and :func:`denone` are other detrend algorithms.

Expand Down Expand Up @@ -427,6 +428,7 @@ def detrend_mean(x, axis=None):
for the default *axis*.

:func:`detrend_linear`

:func:`detrend_none`
:func:`detrend_linear` and :func:`detrend_none` are other
detrend algorithms.
Expand Down Expand Up @@ -474,6 +476,7 @@ def detrend_none(x, axis=None):
for the default *axis*, which has no effect.

:func:`detrend_mean`

:func:`detrend_linear`
:func:`detrend_mean` and :func:`detrend_linear` are other
detrend algorithms.
Expand Down Expand Up @@ -506,6 +509,7 @@ def detrend_linear(y):
for the default *axis*.

:func:`detrend_mean`

:func:`detrend_none`
:func:`detrend_mean` and :func:`detrend_none` are other
detrend algorithms.
Expand Down Expand Up @@ -537,9 +541,11 @@ def stride_windows(x, n, noverlap=None, axis=0):
Get all windows of x with length n as a single array,
using strides to avoid data duplication.

.. warning:: It is not safe to write to the output array. Multiple
elements may point to the same piece of memory, so modifying one value may
change others.
.. warning::

It is not safe to write to the output array. Multiple
elements may point to the same piece of memory,
so modifying one value may change others.

Call signature::

Expand Down Expand Up @@ -599,9 +605,11 @@ def stride_repeat(x, n, axis=0):
Repeat the values in an array in a memory-efficient manner. Array x is
stacked vertically n times.

.. warning:: It is not safe to write to the output array. Multiple
elements may point to the same piece of memory, so modifying one value may
change others.
.. warning::

It is not safe to write to the output array. Multiple
elements may point to the same piece of memory, so
modifying one value may change others.

Call signature::

Expand Down Expand Up @@ -878,6 +886,7 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,

*detrend*: [ 'default' | 'constant' | 'mean' | 'linear' | 'none'] or
callable

The function applied to each segment before fft-ing,
designed to remove the mean or linear trend. Unlike in
MATLAB, where the *detrend* parameter is a vector, in
Expand Down Expand Up @@ -1244,6 +1253,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,

*mode*: [ 'default' | 'psd' | 'complex' | 'magnitude'
'angle' | 'phase' ]

What sort of spectrum to use. Default is 'psd'. which takes the
power spectral density. 'complex' returns the complex-valued
frequency spectrum. 'magnitude' returns the magnitude spectrum.
Expand Down Expand Up @@ -1599,7 +1609,9 @@ def longest_ones(x):
def prepca(P, frac=0):
"""

WARNING: this function is deprecated -- please see class PCA instead
.. warning::

This function is deprecated -- please see class PCA instead

Compute the principal components of *P*. *P* is a (*numVars*,
*numObs*) array. *frac* is the minimum fraction of variance that a
Expand Down
26 changes: 15 additions & 11 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,17 +1311,24 @@ def title(s, *args, **kwargs):
positioned above the axes in the center, flush with the left edge,
and flush with the right edge.

.. seealso::
See :func:`~matplotlib.pyplot.text` for adding text
to the current axes

Parameters
----------
label : str
Text to use for the title

fontdict : dict
A dictionary controlling the appearance of the title text,
the default `fontdict` is:
{'fontsize': rcParams['axes.titlesize'],
'fontweight' : rcParams['axes.titleweight'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}

{'fontsize': rcParams['axes.titlesize'],
'fontweight' : rcParams['axes.titleweight'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}

loc : {'center', 'left', 'right'}, str, optional
Which title to set, defaults to 'center'

Expand All @@ -1332,13 +1339,10 @@ def title(s, *args, **kwargs):

Other parameters
----------------
Other keyword arguments are text properties, see
:class:`~matplotlib.text.Text` for a list of valid text
properties.

See also
--------
See :func:`~matplotlib.pyplot.text` for adding text to the current axes
kwargs : text properties
Other keyword arguments are text properties, see
:class:`~matplotlib.text.Text` for a list of valid text
properties.

"""
l = gca().set_title(s, *args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/tri/trirefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TriRefiner(object):
:class:`~matplotlib.tri.TriInterpolator` (optional)
- the other optional keyword arguments *kwargs* are defined in
each TriRefiner concrete implementation

and which returns (as a tuple) a refined triangular mesh and the
interpolated values of the field at the refined triangulation nodes.

Expand Down
3 changes: 3 additions & 0 deletions lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,12 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
:class:`Path3DCollection` object).

Keywords:

*za* The location or locations to place the patches in the
collection along the *zdir* axis. Defaults to 0.

*zdir* The axis in which to place the patches. Default is "z".

*depthshade* Whether to shade the patches to give a sense of depth.
Defaults to *True*.

Expand Down