8000 Standardize parameter types in docs by timhoffm · Pull Request #15873 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Standardize parameter types in docs #15873

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
Dec 8, 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 lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ def __init__(self, filename, keep_empty=True, metadata=None):
keep_empty : bool, optional
If set to False, then empty pdf files will be deleted automatically
when closed.
metadata : dictionary, optional
metadata : dict, optional
Information dictionary object (see PDF reference section 10.2.1
'Document Information Dictionary'), e.g.:
``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def __init__(self, filename, *, keep_empty=True, metadata=None):
keep_empty : bool, optional
If set to False, then empty pdf files will be deleted automatically
when closed.
metadata : dictionary, optional
metadata : dict, optional
Information dictionary object (see PDF reference section 10.2.1
'Document Information Dictionary'), e.g.:
``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``.
Expand Down
28 changes: 14 additions & 14 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def apply_window(x, window, axis=0, return_window=None):
Either a function to generate a window or an array with length
*x*.shape[*axis*]

axis : integer
axis : int
The axis over which to do the repetition.
Must be 0 or 1. The default is 0

Expand Down Expand Up @@ -157,7 +157,7 @@ def detrend(x, key=None, axis=None):
corresponding functions for more details regarding the algorithms. Can
also be a function that carries out the detrend operation.

axis : integer
axis : int
The axis along which to do the detrending.

See Also
Expand Down Expand Up @@ -201,7 +201,7 @@ def demean(x, axis=0):
Array or sequence containing the data
Can have any dimensionality

axis : integer
axis : int
The axis along which to take the mean. See numpy.mean for a
description of this argument.

Expand All @@ -222,7 +222,7 @@ def detrend_mean(x, axis=None):
Array or sequence containing the data
Can have any dimensionality

axis : integer
axis : int
The axis along which to take the mean. See numpy.mean for a
description of this argument.

Expand All @@ -249,7 +249,7 @@ def detrend_none(x, axis=None):
x : any object
An object containing the data

axis : integer
axis : int
This parameter is ignored.
It is included for compatibility with detrend_mean

Expand All @@ -271,7 +271,7 @@ def detrend_linear(y):
y : 0-D or 1-D array or sequence
Array or sequence containing the data

axis : integer
axis : int
The axis along which to take the mean. See numpy.mean for a
description of this argument.

Expand Down Expand Up @@ -316,14 +316,14 @@ def stride_windows(x, n, noverlap=None, axis=0):
x : 1D array or sequence
Array or sequence containing the data.

n : integer
n : int
The number of data points in each window.

noverlap : integer
noverlap : int
The overlap between adjacent windows.
Default is 0 (no overlap)

axis : integer
axis : int
The axis along which the windows will run.

References
Expand Down Expand Up @@ -385,10 +385,10 @@ def stride_repeat(x, n, axis=0):
x : 1D array or sequence
Array or sequence containing the data.

n : integer
n : int
The number of time to repeat the array.

axis : integer
axis : int
The axis along which the data will run.

References
Expand Down Expand Up @@ -694,7 +694,7 @@ def psd(x, NFFT=None, Fs=None, detrend=None, window=None,

%(PSD)s

noverlap : integer
noverlap : int
The number of points of overlap between segments.
The default value is 0 (no overlap).

Expand Down Expand Up @@ -754,7 +754,7 @@ def csd(x, y, NFFT=None, Fs=None, detrend=None, window=None,

%(PSD)s

noverlap : integer
noverlap : int
The number of points of overlap between segments.
The default value is 0 (no overlap).

Expand Down Expand Up @@ -1059,7 +1059,7 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,

%(PSD)s

noverlap : integer
noverlap : int
The number of points of overlap between blocks. The default value
is 0 (no overlap).

Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ def validate_path_exists(s):


def validate_bool(b):
"""Convert b to a boolean or raise"""
"""Convert b to ``bool`` or raise."""
if isinstance(b, str):
b = b.lower()
if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True):
return True
elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False):
return False
else:
raise ValueError('Could not convert "%s" to boolean' % b)
raise ValueError('Could not convert "%s" to bool' % b)


def validate_bool_maybe_none(b):
"""Convert b to a boolean or raise."""
"""Convert b to ``bool`` or raise, passing thro 67ED ugh *None*."""
if isinstance(b, str):
b = b.lower()
if b is None or b == 'none':
Expand All @@ -143,7 +143,7 @@ def validate_bool_maybe_none(b):
elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False):
return False
else:
raise ValueError('Could not convert "%s" to boolean' % b)
raise ValueError('Could not convert "%s" to bool' % b)


def _validate_tex_preamble(s):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tri/tricontour.py
< A3DB tr data-hunk="0863e425bcf31d423b03a918d1f6c107dfe86df8f1aaae5a769098477fc88e54" class="show-top-border">
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def tricontour(ax, *args, **kwargs):

Optional keyword arguments:

*colors*: [ *None* | string | (mpl_colors) ]
*colors*: [ *None* | str | (mpl_colors) ]
If *None*, the colormap specified by cmap will be used.

If a string, like 'r' or 'red', all levels will be plotted in this
Expand Down
2 changes: 1 addition & 1 deletion tutorials/text/text_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
linespacing `float`
multialignment [``'left'`` | ``'right'`` | ``'center'`` ]
name or fontname string e.g., [``'Sans'`` | ``'Courier'`` | ``'Helvetica'`` ...]
picker [None|float|boolean|callable]
picker [None|float|bool|callable]
position (x, y)
rotation [ angle in degrees | ``'vertical'`` | ``'horizontal'`` ]
size or fontsize [ size in points | relative size, e.g., ``'smaller'``, ``'x-large'`` ]
Expand Down
0