diff --git a/doc/Makefile b/doc/Makefile index 545b10de3384..e6e0689481ca 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -39,7 +39,7 @@ help: @echo " clean to remove generated doc files and start fresh" @echo " docenv make a virtual environment in which to build docs" @echo " html to make standalone HTML files" - @echo " htmlhelp to make HTML files and a HTML help project" + @echo " htmlhelp to make HTML files and an HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" diff --git a/numpy/_core/code_generators/ufunc_docstrings.py b/numpy/_core/code_generators/ufunc_docstrings.py index 1630a9d6f136..40842b1cea43 100644 --- a/numpy/_core/code_generators/ufunc_docstrings.py +++ b/numpy/_core/code_generators/ufunc_docstrings.py @@ -1619,7 +1619,7 @@ def add_newdoc(place, name, doc): returned. In a two's-complement system, this operation effectively flips all the bits, resulting in a representation that corresponds to the negative of the input plus one. This is the most common method of - representing signed integers on computers [1]_. A N-bit two's-complement + representing signed integers on computers [1]_. An N-bit two's-complement system can represent every integer in the range :math:`-2^{N-1}` to :math:`+2^{N-1}-1`. diff --git a/numpy/_core/fromnumeric.py b/numpy/_core/fromnumeric.py index dd94b4d0bed9..e5f4ec0e77f5 100644 --- a/numpy/_core/fromnumeric.py +++ b/numpy/_core/fromnumeric.py @@ -1188,7 +1188,7 @@ def argsort(a, axis=-1, kind=None, order=None, *, stable=None): array([[0, 3], [2, 2]]) - Indices of the sorted elements of a N-dimensional array: + Indices of the sorted elements of an N-dimensional array: >>> ind = np.unravel_index(np.argsort(x, axis=None), x.shape) >>> ind @@ -1275,7 +1275,7 @@ def argmax(a, axis=None, out=None, *, keepdims=np._NoValue): >>> np.argmax(a, axis=1) array([2, 2]) - Indexes of the maximal elements of a N-dimensional array: + Indexes of the maximal elements of an N-dimensional array: >>> a.flat[np.argmax(a)] 15 @@ -1375,7 +1375,7 @@ def argmin(a, axis=None, out=None, *, keepdims=np._NoValue): >>> np.argmin(a, axis=1) array([0, 0]) - Indices of the minimum elements of a N-dimensional array: + Indices of the minimum elements of an N-dimensional array: >>> a.flat[np.argmin(a)] 10 diff --git a/numpy/_core/numeric.py b/numpy/_core/numeric.py index f52d8cdbad8f..f2b79002cfc1 100644 --- a/numpy/_core/numeric.py +++ b/numpy/_core/numeric.py @@ -2010,7 +2010,7 @@ def binary_repr(num, width=None): In a two's-complement system negative numbers are represented by the two's complement of the absolute value. This is the most common method of - representing signed integers on computers [1]_. A N-bit two's-complement + representing signed integers on computers [1]_. An N-bit two's-complement system can represent every integer in the range :math:`-2^{N-1}` to :math:`+2^{N-1}-1`. diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index 72398c5479f8..1c9331fe553a 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -155,7 +155,7 @@ def open(path, mode='r', destpath=os.curdir, encoding=None, newline=None): """ Open `path` with `mode` and return the file object. - If ``path`` is an URL, it will be downloaded, stored in the + If ``path`` is a URL, it will be downloaded, stored in the `DataSource` `destpath` directory and opened from there. Parameters @@ -340,7 +340,7 @@ def _cache(self, path): def _findfile(self, path): """Searches for ``path`` and returns full path if found. - If path is an URL, _findfile will cache a local copy and return the + If path is a URL, _findfile will cache a local copy and return the path to the cached file. If path is a local file, _findfile will return a path to that local file. @@ -372,7 +372,7 @@ def abspath(self, path): """ Return absolute path of file in the DataSource directory. - If `path` is an URL, then `abspath` will return either the location + If `path` is a URL, then `abspath` will return either the location the file exists locally or the location it would exist when opened using the `open` method. @@ -448,7 +448,7 @@ def exists(self, path): Notes ----- - When `path` is an URL, `exists` will return True if it's either + When `path` is a URL, `exists` will return True if it's either stored locally in the `DataSource` directory, or is a valid remote URL. `DataSource` does not discriminate between the two, the file is accessible if it exists in either location. @@ -484,7 +484,7 @@ def open(self, path, mode='r', encoding=None, newline=None): """ Open and return file-like object. - If `path` is an URL, it will be downloaded, stored in the + If `path` is a URL, it will be downloaded, stored in the `DataSource` directory and opened from there. Parameters @@ -594,7 +594,7 @@ def abspath(self, path): """ Return absolute path of file in the Repository directory. - If `path` is an URL, then `abspath` will return either the location + If `path` is a URL, then `abspath` will return either the location the file exists locally or the location it would exist when opened using the `open` method. @@ -639,7 +639,7 @@ def exists(self, path): Notes ----- - When `path` is an URL, `exists` will return True if it's either + When `path` is a URL, `exists` will return True if it's either stored locally in the `DataSource` directory, or is a valid remote URL. `DataSource` does not discriminate between the two, the file is accessible if it exists in either location. @@ -651,7 +651,7 @@ def open(self, path, mode='r', encoding=None, newline=None): """ Open and return file-like object prepending Repository base URL. - If `path` is an URL, it will be downloaded, stored in the + If `path` is a URL, it will be downloaded, stored in the DataSource directory and opened from there. Parameters diff --git a/numpy/lib/_function_base_impl.py b/numpy/lib/_function_base_impl.py index 8698df708b89..2e76633136ee 100644 --- a/numpy/lib/_function_base_impl.py +++ b/numpy/lib/_function_base_impl.py @@ -3073,15 +3073,14 @@ def blackman(M): "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. It is known as a "near optimal" tapering function, almost as good (by some measures) - as the kaiser window. + as the Kaiser window. References ---------- - Blackman, R.B. and Tukey, J.W., (1958) The measurement of power spectra, - Dover Publications, New York. - - Oppenheim, A.V., and R.W. Schafer. Discrete-Time Signal Processing. - Upper Saddle River, NJ: Prentice-Hall, 1999, pp. 468-471. + .. [1] Blackman, R.B. and Tukey, J.W., (1958) + The measurement of power spectra, Dover Publications, New York. + .. [2] Oppenheim, A.V., and R.W. Schafer. Discrete-Time Signal Processing. + Upper Saddle River, NJ: Prentice-Hall, 1999, pp. 468-471. Examples -------- diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py index 2dd19410bbf0..dece6823f09f 100644 --- a/numpy/lib/tests/test__datasource.py +++ b/numpy/lib/tests/test__datasource.py @@ -289,7 +289,7 @@ def test_RemoveHTTPFile(self, tmp_path): def test_CachedHTTPFile(self, tmp_path): localfile = valid_httpurl() - # Create a locally cached temp file with an URL based + # Create a locally cached temp file with a URL based # directory structure. This is similar to what Repository.open # would do. repos = datasource.Repository(valid_baseurl(), tmp_path) diff --git a/numpy/ma/core.pyi b/numpy/ma/core.pyi index fb54cc7b8238..2173e0e76f04 100644 --- a/numpy/ma/core.pyi +++ b/numpy/ma/core.pyi @@ -618,7 +618,7 @@ def getmaskarray(arr: _ScalarLike_co) -> _MaskArray[tuple[()]]: ... def getmaskarray[ShapeT: _Shape](arr: np.ndarray[ShapeT, Any]) -> _MaskArray[ShapeT]: ... # It's sufficient for `m` to have dtype with type: `type[np.bool_]`, -# which isn't necessarily a ndarray. Please open an issue if this causes issues. +# which isn't necessarily an ndarray. Please open an issue if this causes issues. def is_mask(m: object) -> TypeIs[NDArray[bool_]]: ... # diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index 55b48b905848..4dd2a85e15d7 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -1420,7 +1420,7 @@ def chebvander2d(x, y, deg): correspond to the elements of a 2-D coefficient array `c` of shape (xdeg + 1, ydeg + 1) in the order - .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ... + .. math:: c_{00}, c_{01}, c_{02}, ... , c_{10}, c_{11}, c_{12}, ... and ``np.dot(V, c.flat)`` and ``chebval2d(x, y, c)`` will be the same up to roundoff. This equivalence is useful both for least squares diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py index c6007d19df7f..1bf99461b8e8 100644 --- a/numpy/polynomial/hermite.py +++ b/numpy/polynomial/hermite.py @@ -1198,7 +1198,7 @@ def hermvander2d(x, y, deg): correspond to the elements of a 2-D coefficient array `c` of shape (xdeg + 1, ydeg + 1) in the order - .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ... + .. math:: c_{00}, c_{01}, c_{02}, ... , c_{10}, c_{11}, c_{12}, ... and ``np.dot(V, c.flat)`` and ``hermval2d(x, y, c)`` will be the same up to roundoff. This equivalence is useful both for least squares diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py index f5d82aa543b9..730b60804e9a 100644 --- a/numpy/polynomial/hermite_e.py +++ b/numpy/polynomial/hermite_e.py @@ -1147,7 +1147,7 @@ def hermevander2d(x, y, deg): correspond to the elements of a 2-D coefficient array `c` of shape (xdeg + 1, ydeg + 1) in the order - .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ... + .. math:: c_{00}, c_{01}, c_{02}, ... , c_{10}, c_{11}, c_{12}, ... and ``np.dot(V, c.flat)`` and ``hermeval2d(x, y, c)`` will be the same up to roundoff. This equivalence is useful both for least squares diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index 237e340cbf45..b611aed844e7 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -1372,7 +1372,7 @@ def legcompanion(c): """Return the scaled companion matrix of c. The basis polynomials are scaled so that the companion matrix is - symmetric when `c` is an Legendre basis polynomial. This provides + symmetric when `c` is a Legendre basis polynomial. This provides better eigenvalue estimates than the unscaled case and for basis polynomials the eigenvalues are guaranteed to be real if `numpy.linalg.eigvalsh` is used to obtain them. diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index e3823c89cd98..a2ea62c9e666 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -1154,7 +1154,7 @@ def polyvander2d(x, y, deg): correspond to the elements of a 2-D coefficient array `c` of shape (xdeg + 1, ydeg + 1) in the order - .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ... + .. math:: c_{00}, c_{01}, c_{02}, ... , c_{10}, c_{11}, c_{12}, ... and ``np.dot(V, c.flat)`` and ``polyval2d(x, y, c)`` will be the same up to roundoff. This equivalence is useful both for least squares