Skip to content

Commit 28e624d

Browse files
authored
Merge pull request #21291 from oscargus/spaceandcos
DOC: Add space after argument name
2 parents ca85c17 + 782fdec commit 28e624d

File tree

8 files changed

+60
-61
lines changed

8 files changed

+60
-61
lines changed

numpy/core/code_generators/generate_umath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class TypeDescription:
5454
cfunc_alias : str or none, optional
5555
Appended to inner loop C function name, e.g., FLOAT_{cfunc_alias}. See make_arrays.
5656
NOTE: it doesn't support 'astype'
57-
simd: list
57+
simd : list
5858
Available SIMD ufunc loops, dispatched at runtime in specified order
5959
Currently only supported for simples types (see make_arrays)
60-
dispatch: str or None, optional
60+
dispatch : str or None, optional
6161
Dispatch-able source name without its extension '.dispatch.c' that
6262
contains the definition of ufunc, dispatched at runtime depending on the
6363
specified targets of the dispatch-able source.

numpy/distutils/ccompiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def CCompiler_spawn(self, cmd, display=None, env=None):
120120
display : str or sequence of str, optional
121121
The text to add to the log file kept by `numpy.distutils`.
122122
If not given, `display` is equal to `cmd`.
123-
env: a dictionary for environment variables, optional
123+
env : a dictionary for environment variables, optional
124124
125125
Returns
126126
-------

numpy/distutils/ccompiler_opt.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -769,18 +769,18 @@ class _Cache:
769769
770770
Parameters
771771
----------
772-
cache_path: str or None
772+
cache_path : str or None
773773
The path of cache file, if None then cache in file will disabled.
774774
775-
*factors:
775+
*factors :
776776
The caching factors that need to utilize next to `conf_cache_factors`.
777777
778778
Attributes
779779
----------
780-
cache_private: set
780+
cache_private : set
781781
Hold the attributes that need be skipped from "in-memory cache".
782782
783-
cache_infile: bool
783+
cache_infile : bool
784784
Utilized during initializing this class, to determine if the cache was able
785785
to loaded from the specified cache path in 'cache_path'.
786786
"""
@@ -1231,12 +1231,12 @@ def feature_names(self, names=None, force_flags=None, macros=[]):
12311231
12321232
Parameters
12331233
----------
1234-
names: sequence or None, optional
1234+
names : sequence or None, optional
12351235
Specify certain CPU features to test it against the **C** compiler.
12361236
if None(default), it will test all current supported features.
12371237
**Note**: feature names must be in upper-case.
12381238
1239-
force_flags: list or None, optional
1239+
force_flags : list or None, optional
12401240
If None(default), default compiler flags for every CPU feature will
12411241
be used during the test.
12421242
@@ -1305,10 +1305,10 @@ def feature_implies(self, names, keep_origins=False):
13051305
13061306
Parameters
13071307
----------
1308-
names: str or sequence of str
1308+
names : str or sequence of str
13091309
CPU feature name(s) in uppercase.
13101310
1311-
keep_origins: bool
1311+
keep_origins : bool
13121312
if False(default) then the returned set will not contain any
13131313
features from 'names'. This case happens only when two features
13141314
imply each other.
@@ -1498,10 +1498,10 @@ def feature_test(self, name, force_flags=None, macros=[]):
14981498
14991499
Parameters
15001500
----------
1501-
name: str
1501+
name : str
15021502
Supported CPU feature name.
15031503
1504-
force_flags: list or None, optional
1504+
force_flags : list or None, optional
15051505
If None(default), the returned flags from `feature_flags()`
15061506
will be used.
15071507
@@ -1537,10 +1537,10 @@ def feature_is_supported(self, name, force_flags=None, macros=[]):
15371537
15381538
Parameters
15391539
----------
1540-
name: str
1540+
name : str
15411541
CPU feature name in uppercase.
15421542
1543-
force_flags: list or None, optional
1543+
force_flags : list or None, optional
15441544
If None(default), default compiler flags for every CPU feature will
15451545
be used during test.
15461546
@@ -1582,7 +1582,7 @@ def feature_extra_checks(self, name):
15821582
15831583
Parameters
15841584
----------
1585-
names: str
1585+
names : str
15861586
CPU feature name in uppercase.
15871587
"""
15881588
assert isinstance(name, str)
@@ -1668,10 +1668,10 @@ class _Parse:
16681668
16691669
Parameters
16701670
----------
1671-
cpu_baseline: str or None
1671+
cpu_baseline : str or None
16721672
minimal set of required CPU features or special options.
16731673
1674-
cpu_dispatch: str or None
1674+
cpu_dispatch : str or None
16751675
dispatched set of additional CPU features or special options.
16761676
16771677
Special options can be:
@@ -1804,7 +1804,7 @@ def parse_targets(self, source):
18041804
18051805
Parameters
18061806
----------
1807-
source: str
1807+
source : str
18081808
the path of **C** source file.
18091809
18101810
Returns
@@ -2243,7 +2243,7 @@ def try_dispatch(self, sources, src_dir=None, ccompiler=None, **kwargs):
22432243
Path of parent directory for the generated headers and wrapped sources.
22442244
If None(default) the files will generated in-place.
22452245
2246-
ccompiler: CCompiler
2246+
ccompiler : CCompiler
22472247
Distutils `CCompiler` instance to be used for compilation.
22482248
If None (default), the provided instance during the initialization
22492249
will be used instead.

numpy/lib/format.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ def _write_array_header(fp, d, version=None):
421421
d : dict
422422
This has the appropriate entries for writing its string representation
423423
to the header of the file.
424-
version: tuple or None
425-
None means use oldest that works
426-
explicit version will raise a ValueError if the format does not
427-
allow saving this data. Default: None
424+
version : tuple or None
425+
None means use oldest that works. Providing an explicit version will
426+
raise a ValueError if the format does not allow saving this data.
427+
Default: None
428428
"""
429429
header = ["{"]
430430
for key, value in sorted(d.items()):

numpy/lib/function_base.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def rot90(m, k=1, axes=(0, 1)):
168168
Array of two or more dimensions.
169169
k : integer
170170
Number of times the array is rotated by 90 degrees.
171-
axes: (2,) array_like
171+
axes : (2,) array_like
172172
The array is rotated in the plane defined by the axes.
173173
Axes must be different.
174174
@@ -1656,7 +1656,7 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi):
16561656
larger than ``period/2``.
16571657
axis : int, optional
16581658
Axis along which unwrap will operate, default is the last axis.
1659-
period: float, optional
1659+
period : float, optional
16601660
Size of the range over which the input wraps. By default, it is
16611661
``2 pi``.
16621662
@@ -2974,15 +2974,14 @@ def bartlett(M):
29742974
\\frac{M-1}{2} - \\left|n - \\frac{M-1}{2}\\right|
29752975
\\right)
29762976
2977-
Most references to the Bartlett window come from the signal
2978-
processing literature, where it is used as one of many windowing
2979-
functions for smoothing values. Note that convolution with this
2980-
window produces linear interpolation. It is also known as an
2981-
apodization (which means"removing the foot", i.e. smoothing
2982-
discontinuities at the beginning and end of the sampled signal) or
2983-
tapering function. The fourier transform of the Bartlett is the product
2984-
of two sinc functions.
2985-
Note the excellent discussion in Kanasewich.
2977+
Most references to the Bartlett window come from the signal processing
2978+
literature, where it is used as one of many windowing functions for
2979+
smoothing values. Note that convolution with this window produces linear
2980+
interpolation. It is also known as an apodization (which means "removing
2981+
the foot", i.e. smoothing discontinuities at the beginning and end of the
2982+
sampled signal) or tapering function. The Fourier transform of the
2983+
Bartlett window is the product of two sinc functions. Note the excellent
2984+
discussion in Kanasewich [2]_.
29862985
29872986
References
29882987
----------
@@ -3075,7 +3074,7 @@ def hanning(M):
30753074
-----
30763075
The Hanning window is defined as
30773076
3078-
.. math:: w(n) = 0.5 - 0.5cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
3077+
.. math:: w(n) = 0.5 - 0.5\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
30793078
\\qquad 0 \\leq n \\leq M-1
30803079
30813080
The Hanning was named for Julius von Hann, an Austrian meteorologist.
@@ -3179,7 +3178,7 @@ def hamming(M):
31793178
-----
31803179
The Hamming window is defined as
31813180
3182-
.. math:: w(n) = 0.54 - 0.46cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
3181+
.. math:: w(n) = 0.54 - 0.46\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
31833182
\\qquad 0 \\leq n \\leq M-1
31843183
31853184
The Hamming was named for R. W. Hamming, an associate of J. W. Tukey
@@ -4731,10 +4730,10 @@ def trapz(y, x=None, dx=1.0, axis=-1):
47314730
Returns
47324731
-------
47334732
trapz : float or ndarray
4734-
Definite integral of 'y' = n-dimensional array as approximated along
4735-
a single axis by the trapezoidal rule. If 'y' is a 1-dimensional array,
4736-
then the result is a float. If 'n' is greater than 1, then the result
4737-
is an 'n-1' dimensional array.
4733+
Definite integral of `y` = n-dimensional array as approximated along
4734+
a single axis by the trapezoidal rule. If `y` is a 1-dimensional array,
4735+
then the result is a float. If `n` is greater than 1, then the result
4736+
is an `n`-1 dimensional array.
47384737
47394738
See Also
47404739
--------
@@ -4865,9 +4864,9 @@ def meshgrid(*xi, copy=True, sparse=False, indexing='xy'):
48654864
Returns
48664865
-------
48674866
X1, X2,..., XN : ndarray
4868-
For vectors `x1`, `x2`,..., 'xn' with lengths ``Ni=len(xi)`` ,
4869-
return ``(N1, N2, N3,...Nn)`` shaped arrays if indexing='ij'
4870-
or ``(N2, N1, N3,...Nn)`` shaped arrays if indexing='xy'
4867+
For vectors `x1`, `x2`,..., `xn` with lengths ``Ni=len(xi)``,
4868+
returns ``(N1, N2, N3,..., Nn)`` shaped arrays if indexing='ij'
4869+
or ``(N2, N1, N3,..., Nn)`` shaped arrays if indexing='xy'
48714870
with the elements of `xi` repeated to fill the matrix along
48724871
the first dimension for `x1`, the second for `x2` and so on.
48734872
@@ -5016,7 +5015,7 @@ def delete(arr, obj, axis=None):
50165015
>>> mask[[0,2,4]] = False
50175016
>>> result = arr[mask,...]
50185017
5019-
Is equivalent to `np.delete(arr, [0,2,4], axis=0)`, but allows further
5018+
Is equivalent to ``np.delete(arr, [0,2,4], axis=0)``, but allows further
50205019
use of `mask`.
50215020
50225021
Examples
@@ -5207,9 +5206,9 @@ def insert(arr, obj, values, axis=None):
52075206
52085207
Notes
52095208
-----
5210-
Note that for higher dimensional inserts `obj=0` behaves very different
5211-
from `obj=[0]` just like `arr[:,0,:] = values` is different from
5212-
`arr[:,[0],:] = values`.
5209+
Note that for higher dimensional inserts ``obj=0`` behaves very different
5210+
from ``obj=[0]`` just like ``arr[:,0,:] = values`` is different from
5211+
``arr[:,[0],:] = values``.
52135212
52145213
Examples
52155214
--------

numpy/lib/npyio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def load(file, mmap_mode=None, allow_pickle=False, fix_imports=True,
287287
----------
288288
file : file-like object, string, or pathlib.Path
289289
The file to read. File-like objects must support the
290-
``seek()`` and ``read()`` methods and must always
290+
``seek()`` and ``read()`` methods and must always
291291
be opened in binary mode. Pickled files require that the
292292
file-like object support the ``readline()`` method as well.
293293
mmap_mode : {None, 'r+', 'r', 'w+', 'c'}, optional
@@ -737,9 +737,9 @@ def _ensure_ndmin_ndarray(a, *, ndmin: int):
737737
"""This is a helper function of loadtxt and genfromtxt to ensure
738738
proper minimum dimension as requested
739739
740-
ndim: int. Supported values 1, 2, 3
741-
^^ whenever this changes, keep in sync with
742-
_ensure_ndmin_ndarray_check_param
740+
ndim : int. Supported values 1, 2, 3
741+
^^ whenever this changes, keep in sync with
742+
_ensure_ndmin_ndarray_check_param
743743
"""
744744
# Verify that the array has at least dimensions `ndmin`.
745745
# Tweak the size and shape of the arrays - remove extraneous dimensions

numpy/ma/core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def _recursive_set_fill_value(fillvalue, dt):
405405
406406
Returns
407407
-------
408-
val: tuple
408+
val : tuple
409409
A tuple of values corresponding to the structured fill value.
410410
411411
"""
@@ -2842,7 +2842,7 @@ def __new__(cls, data=None, mask=nomask, dtype=None, copy=False,
28422842
# still has the _mask attribute like MaskedArrays
28432843
if hasattr(data, '_mask') and not isinstance(data, ndarray):
28442844
_data._mask = data._mask
2845-
# FIXME: should we set `_data._sharedmask = True`?
2845+
# FIXME: should we set `_data._sharedmask = True`?
28462846
# Process mask.
28472847
# Type of the mask
28482848
mdtype = make_mask_descr(_data.dtype)
@@ -3584,7 +3584,7 @@ def hardmask(self):
35843584
By default, assigning definite values to masked array entries will
35853585
unmask them. When `hardmask` is ``True``, the mask will not change
35863586
through assignments.
3587-
3587+
35883588
See Also
35893589
--------
35903590
ma.MaskedArray.harden_mask
@@ -8208,7 +8208,7 @@ def __call__(self, *args, **params):
82088208

82098209

82108210
arange = _convert2ma(
8211-
'arange',
8211+
'arange',
82128212
params=dict(fill_value=None, hardmask=False),
82138213
np_ret='arange : ndarray',
82148214
np_ma_ret='arange : MaskedArray',
@@ -8226,7 +8226,7 @@ def __call__(self, *args, **params):
82268226
np_ma_ret='diff : MaskedArray',
82278227
)
82288228
empty = _convert2ma(
8229-
'empty',
8229+
'empty',
82308230
params=dict(fill_value=None, hardmask=False),
82318231
np_ret='out : ndarray',
82328232
np_ma_ret='out : MaskedArray',
@@ -8247,7 +8247,7 @@ def __call__(self, *args, **params):
82478247
np_ma_ret='fromfunction: MaskedArray',
82488248
)
82498249
identity = _convert2ma(
8250-
'identity',
8250+
'identity',
82518251
params=dict(fill_value=None, hardmask=False),
82528252
np_ret='out : ndarray',
82538253
np_ma_ret='out : MaskedArray',

numpy/random/_pickle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __generator_ctor(bit_generator_name='MT19937'):
2525
2626
Returns
2727
-------
28-
rg: Generator
28+
rg : Generator
2929
Generator using the named core BitGenerator
3030
"""
3131
if bit_generator_name in BitGenerators:
@@ -48,7 +48,7 @@ def __bit_generator_ctor(bit_generator_name='MT19937'):
4848
4949
Returns
5050
-------
51-
bit_generator: BitGenerator
51+
bit_generator : BitGenerator
5252
BitGenerator instance
5353
"""
5454
if bit_generator_name in BitGenerators:
@@ -71,7 +71,7 @@ def __randomstate_ctor(bit_generator_name='MT19937'):
7171
7272
Returns
7373
-------
74-
rs: RandomState
74+
rs : RandomState
7575
Legacy RandomState using the named core BitGenerator
7676
"""
7777
if bit_generator_name in BitGenerators:

0 commit comments

Comments
 (0)