diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-04-07 01:02:24 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 01:02:24 -0600 |
commit | 28e624d1e78ee46d7040e6a099bda39d7fa60e3d (patch) | |
tree | a06138bca035d10cab34ddd950fdbf8ff7d464d0 | |
parent | ca85c17e712c93717abb5c2b921393c3ecfc47c4 (diff) | |
parent | 782fdec661e8ba24f31a1b8886ec9a0a4301efd2 (diff) | |
download | numpy-28e624d1e78ee46d7040e6a099bda39d7fa60e3d.tar.gz |
Merge pull request #21291 from oscargus/spaceandcos
DOC: Add space after argument name
-rw-r--r-- | numpy/core/code_generators/generate_umath.py | 4 | ||||
-rw-r--r-- | numpy/distutils/ccompiler.py | 2 | ||||
-rw-r--r-- | numpy/distutils/ccompiler_opt.py | 34 | ||||
-rw-r--r-- | numpy/lib/format.py | 8 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 47 | ||||
-rw-r--r-- | numpy/lib/npyio.py | 8 | ||||
-rw-r--r-- | numpy/ma/core.py | 12 | ||||
-rw-r--r-- | numpy/random/_pickle.py | 6 |
8 files changed, 60 insertions, 61 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index a33b1f790..687b80665 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -54,10 +54,10 @@ class TypeDescription: cfunc_alias : str or none, optional Appended to inner loop C function name, e.g., FLOAT_{cfunc_alias}. See make_arrays. NOTE: it doesn't support 'astype' - simd: list + simd : list Available SIMD ufunc loops, dispatched at runtime in specified order Currently only supported for simples types (see make_arrays) - dispatch: str or None, optional + dispatch : str or None, optional Dispatch-able source name without its extension '.dispatch.c' that contains the definition of ufunc, dispatched at runtime depending on the specified targets of the dispatch-able source. diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py index 74e2c51f6..df268d1de 100644 --- a/numpy/distutils/ccompiler.py +++ b/numpy/distutils/ccompiler.py @@ -120,7 +120,7 @@ def CCompiler_spawn(self, cmd, display=None, env=None): display : str or sequence of str, optional The text to add to the log file kept by `numpy.distutils`. If not given, `display` is equal to `cmd`. - env: a dictionary for environment variables, optional + env : a dictionary for environment variables, optional Returns ------- diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py index 6d2114c95..f22c6da63 100644 --- a/numpy/distutils/ccompiler_opt.py +++ b/numpy/distutils/ccompiler_opt.py @@ -769,18 +769,18 @@ class _Cache: Parameters ---------- - cache_path: str or None + cache_path : str or None The path of cache file, if None then cache in file will disabled. - *factors: + *factors : The caching factors that need to utilize next to `conf_cache_factors`. Attributes ---------- - cache_private: set + cache_private : set Hold the attributes that need be skipped from "in-memory cache". - cache_infile: bool + cache_infile : bool Utilized during initializing this class, to determine if the cache was able to loaded from the specified cache path in 'cache_path'. """ @@ -1231,12 +1231,12 @@ class _Feature: Parameters ---------- - names: sequence or None, optional + names : sequence or None, optional Specify certain CPU features to test it against the **C** compiler. if None(default), it will test all current supported features. **Note**: feature names must be in upper-case. - force_flags: list or None, optional + force_flags : list or None, optional If None(default), default compiler flags for every CPU feature will be used during the test. @@ -1305,10 +1305,10 @@ class _Feature: Parameters ---------- - names: str or sequence of str + names : str or sequence of str CPU feature name(s) in uppercase. - keep_origins: bool + keep_origins : bool if False(default) then the returned set will not contain any features from 'names'. This case happens only when two features imply each other. @@ -1498,10 +1498,10 @@ class _Feature: Parameters ---------- - name: str + name : str Supported CPU feature name. - force_flags: list or None, optional + force_flags : list or None, optional If None(default), the returned flags from `feature_flags()` will be used. @@ -1537,10 +1537,10 @@ class _Feature: Parameters ---------- - name: str + name : str CPU feature name in uppercase. - force_flags: list or None, optional + force_flags : list or None, optional If None(default), default compiler flags for every CPU feature will be used during test. @@ -1582,7 +1582,7 @@ class _Feature: Parameters ---------- - names: str + names : str CPU feature name in uppercase. """ assert isinstance(name, str) @@ -1668,10 +1668,10 @@ class _Parse: Parameters ---------- - cpu_baseline: str or None + cpu_baseline : str or None minimal set of required CPU features or special options. - cpu_dispatch: str or None + cpu_dispatch : str or None dispatched set of additional CPU features or special options. Special options can be: @@ -1804,7 +1804,7 @@ class _Parse: Parameters ---------- - source: str + source : str the path of **C** source file. Returns @@ -2243,7 +2243,7 @@ class CCompilerOpt(_Config, _Distutils, _Cache, _CCompiler, _Feature, _Parse): Path of parent directory for the generated headers and wrapped sources. If None(default) the files will generated in-place. - ccompiler: CCompiler + ccompiler : CCompiler Distutils `CCompiler` instance to be used for compilation. If None (default), the provided instance during the initialization will be used instead. diff --git a/numpy/lib/format.py b/numpy/lib/format.py index 3967b43ee..264fff8d6 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -421,10 +421,10 @@ def _write_array_header(fp, d, version=None): d : dict This has the appropriate entries for writing its string representation to the header of the file. - version: tuple or None - None means use oldest that works - explicit version will raise a ValueError if the format does not - allow saving this data. Default: None + version : tuple or None + None means use oldest that works. Providing an explicit version will + raise a ValueError if the format does not allow saving this data. + Default: None """ header = ["{"] for key, value in sorted(d.items()): diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index f69604d6e..d611dd225 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -168,7 +168,7 @@ def rot90(m, k=1, axes=(0, 1)): Array of two or more dimensions. k : integer Number of times the array is rotated by 90 degrees. - axes: (2,) array_like + axes : (2,) array_like The array is rotated in the plane defined by the axes. Axes must be different. @@ -1656,7 +1656,7 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi): larger than ``period/2``. axis : int, optional Axis along which unwrap will operate, default is the last axis. - period: float, optional + period : float, optional Size of the range over which the input wraps. By default, it is ``2 pi``. @@ -2974,15 +2974,14 @@ def bartlett(M): \\frac{M-1}{2} - \\left|n - \\frac{M-1}{2}\\right| \\right) - Most references to the Bartlett window come from the signal - processing literature, where it is used as one of many windowing - functions for smoothing values. Note that convolution with this - window produces linear interpolation. It is also known as an - apodization (which means"removing the foot", i.e. smoothing - discontinuities at the beginning and end of the sampled signal) or - tapering function. The fourier transform of the Bartlett is the product - of two sinc functions. - Note the excellent discussion in Kanasewich. + Most references to the Bartlett window come from the signal processing + literature, where it is used as one of many windowing functions for + smoothing values. Note that convolution with this window produces linear + interpolation. It is also known as an apodization (which means "removing + the foot", i.e. smoothing discontinuities at the beginning and end of the + sampled signal) or tapering function. The Fourier transform of the + Bartlett window is the product of two sinc functions. Note the excellent + discussion in Kanasewich [2]_. References ---------- @@ -3075,7 +3074,7 @@ def hanning(M): ----- The Hanning window is defined as - .. math:: w(n) = 0.5 - 0.5cos\\left(\\frac{2\\pi{n}}{M-1}\\right) + .. math:: w(n) = 0.5 - 0.5\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right) \\qquad 0 \\leq n \\leq M-1 The Hanning was named for Julius von Hann, an Austrian meteorologist. @@ -3179,7 +3178,7 @@ def hamming(M): ----- The Hamming window is defined as - .. math:: w(n) = 0.54 - 0.46cos\\left(\\frac{2\\pi{n}}{M-1}\\right) + .. math:: w(n) = 0.54 - 0.46\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right) \\qquad 0 \\leq n \\leq M-1 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): Returns ------- trapz : float or ndarray - Definite integral of 'y' = n-dimensional array as approximated along - a single axis by the trapezoidal rule. If 'y' is a 1-dimensional array, - then the result is a float. If 'n' is greater than 1, then the result - is an 'n-1' dimensional array. + Definite integral of `y` = n-dimensional array as approximated along + a single axis by the trapezoidal rule. If `y` is a 1-dimensional array, + then the result is a float. If `n` is greater than 1, then the result + is an `n`-1 dimensional array. See Also -------- @@ -4865,9 +4864,9 @@ def meshgrid(*xi, copy=True, sparse=False, indexing='xy'): Returns ------- X1, X2,..., XN : ndarray - For vectors `x1`, `x2`,..., 'xn' with lengths ``Ni=len(xi)`` , - return ``(N1, N2, N3,...Nn)`` shaped arrays if indexing='ij' - or ``(N2, N1, N3,...Nn)`` shaped arrays if indexing='xy' + For vectors `x1`, `x2`,..., `xn` with lengths ``Ni=len(xi)``, + returns ``(N1, N2, N3,..., Nn)`` shaped arrays if indexing='ij' + or ``(N2, N1, N3,..., Nn)`` shaped arrays if indexing='xy' with the elements of `xi` repeated to fill the matrix along the first dimension for `x1`, the second for `x2` and so on. @@ -5016,7 +5015,7 @@ def delete(arr, obj, axis=None): >>> mask[[0,2,4]] = False >>> result = arr[mask,...] - Is equivalent to `np.delete(arr, [0,2,4], axis=0)`, but allows further + Is equivalent to ``np.delete(arr, [0,2,4], axis=0)``, but allows further use of `mask`. Examples @@ -5207,9 +5206,9 @@ def insert(arr, obj, values, axis=None): Notes ----- - Note that for higher dimensional inserts `obj=0` behaves very different - from `obj=[0]` just like `arr[:,0,:] = values` is different from - `arr[:,[0],:] = values`. + Note that for higher dimensional inserts ``obj=0`` behaves very different + from ``obj=[0]`` just like ``arr[:,0,:] = values`` is different from + ``arr[:,[0],:] = values``. Examples -------- diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 90424aab4..33b49127c 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -287,7 +287,7 @@ def load(file, mmap_mode=None, allow_pickle=False, fix_imports=True, ---------- file : file-like object, string, or pathlib.Path The file to read. File-like objects must support the - ``seek()`` and ``read()`` methods and must always + ``seek()`` and ``read()`` methods and must always be opened in binary mode. Pickled files require that the file-like object support the ``readline()`` method as well. mmap_mode : {None, 'r+', 'r', 'w+', 'c'}, optional @@ -737,9 +737,9 @@ def _ensure_ndmin_ndarray(a, *, ndmin: int): """This is a helper function of loadtxt and genfromtxt to ensure proper minimum dimension as requested - ndim: int. Supported values 1, 2, 3 - ^^ whenever this changes, keep in sync with - _ensure_ndmin_ndarray_check_param + ndim : int. Supported values 1, 2, 3 + ^^ whenever this changes, keep in sync with + _ensure_ndmin_ndarray_check_param """ # Verify that the array has at least dimensions `ndmin`. # Tweak the size and shape of the arrays - remove extraneous dimensions diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 9c9dfac68..ed17b1b22 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -405,7 +405,7 @@ def _recursive_set_fill_value(fillvalue, dt): Returns ------- - val: tuple + val : tuple A tuple of values corresponding to the structured fill value. """ @@ -2842,7 +2842,7 @@ class MaskedArray(ndarray): # still has the _mask attribute like MaskedArrays if hasattr(data, '_mask') and not isinstance(data, ndarray): _data._mask = data._mask - # FIXME: should we set `_data._sharedmask = True`? + # FIXME: should we set `_data._sharedmask = True`? # Process mask. # Type of the mask mdtype = make_mask_descr(_data.dtype) @@ -3584,7 +3584,7 @@ class MaskedArray(ndarray): By default, assigning definite values to masked array entries will unmask them. When `hardmask` is ``True``, the mask will not change through assignments. - + See Also -------- ma.MaskedArray.harden_mask @@ -8208,7 +8208,7 @@ class _convert2ma: arange = _convert2ma( - 'arange', + 'arange', params=dict(fill_value=None, hardmask=False), np_ret='arange : ndarray', np_ma_ret='arange : MaskedArray', @@ -8226,7 +8226,7 @@ diff = _convert2ma( np_ma_ret='diff : MaskedArray', ) empty = _convert2ma( - 'empty', + 'empty', params=dict(fill_value=None, hardmask=False), np_ret='out : ndarray', np_ma_ret='out : MaskedArray', @@ -8247,7 +8247,7 @@ fromfunction = _convert2ma( np_ma_ret='fromfunction: MaskedArray', ) identity = _convert2ma( - 'identity', + 'identity', params=dict(fill_value=None, hardmask=False), np_ret='out : ndarray', np_ma_ret='out : MaskedArray', diff --git a/numpy/random/_pickle.py b/numpy/random/_pickle.py index a32f64f4a..5e89071e8 100644 --- a/numpy/random/_pickle.py +++ b/numpy/random/_pickle.py @@ -25,7 +25,7 @@ def __generator_ctor(bit_generator_name='MT19937'): Returns ------- - rg: Generator + rg : Generator Generator using the named core BitGenerator """ if bit_generator_name in BitGenerators: @@ -48,7 +48,7 @@ def __bit_generator_ctor(bit_generator_name='MT19937'): Returns ------- - bit_generator: BitGenerator + bit_generator : BitGenerator BitGenerator instance """ if bit_generator_name in BitGenerators: @@ -71,7 +71,7 @@ def __randomstate_ctor(bit_generator_name='MT19937'): Returns ------- - rs: RandomState + rs : RandomState Legacy RandomState using the named core BitGenerator """ if bit_generator_name in BitGenerators: |