diff options
author | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2022-10-07 10:00:52 +0200 |
---|---|---|
committer | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2022-10-07 10:21:11 +0200 |
commit | 8551018184e16dc76cadb05cfaf73985105a3293 (patch) | |
tree | bc4b1ff327f4c6b3f835a44a509414a1f9889f81 /numpy | |
parent | b347b4d2043ac97af3583b1038f2c02bdadcf3db (diff) | |
download | numpy-8551018184e16dc76cadb05cfaf73985105a3293.tar.gz |
MAINT: Fix typos found by codespell
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/__init__.pyi | 4 | ||||
-rw-r--r-- | numpy/_pyinstaller/pyinstaller-smoke.py | 2 | ||||
-rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 2 | ||||
-rw-r--r-- | numpy/core/src/common/simd/avx2/math.h | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/arraytypes.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/flagsobject.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/hashdescr.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/textreading/conversions.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/textreading/field_types.h | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/textreading/rows.c | 2 | ||||
-rw-r--r-- | numpy/core/src/npysort/x86-qsort.dispatch.cpp | 6 | ||||
-rw-r--r-- | numpy/core/src/umath/loops_hyperbolic.dispatch.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/umath/scalarmath.c.src | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_array_interface.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 4 | ||||
-rw-r--r-- | numpy/core/tests/test_scalarmath.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_umath.py | 6 | ||||
-rw-r--r-- | numpy/f2py/src/fortranobject.c | 2 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 2 | ||||
-rw-r--r-- | numpy/random/_generator.pyx | 4 |
20 files changed, 27 insertions, 27 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index d9b50b7b4..f23050b17 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -1435,7 +1435,7 @@ _ShapeType2 = TypeVar("_ShapeType2", bound=Any) _NumberType = TypeVar("_NumberType", bound=number[Any]) # There is currently no exhaustive way to type the buffer protocol, -# as it is implemented exclusivelly in the C API (python/typing#593) +# as it is implemented exclusively in the C API (python/typing#593) _SupportsBuffer = Union[ bytes, bytearray, @@ -3754,7 +3754,7 @@ class memmap(ndarray[_ShapeType, _DType_co]): ) -> Any: ... def flush(self) -> None: ... -# TODO: Add a mypy plugin for managing functions whose output type is dependant +# TODO: Add a mypy plugin for managing functions whose output type is dependent # on the literal value of some sort of signature (e.g. `einsum` and `vectorize`) class vectorize: pyfunc: Callable[..., Any] diff --git a/numpy/_pyinstaller/pyinstaller-smoke.py b/numpy/_pyinstaller/pyinstaller-smoke.py index 1c9f78ae3..eb28070e3 100644 --- a/numpy/_pyinstaller/pyinstaller-smoke.py +++ b/numpy/_pyinstaller/pyinstaller-smoke.py @@ -4,7 +4,7 @@ PyInstaller typically goes wrong by forgetting to package modules, extension modules or shared libraries. This script should aim to touch as many of those as possible in an attempt to trip a ModuleNotFoundError or a DLL load failure due to an uncollected resource. Missing resources are unlikely to lead to -arithmitic errors so there's generally no need to verify any calculation's +arithmetic errors so there's generally no need to verify any calculation's output - merely that it made it to the end OK. This script should not explicitly import any of numpy's submodules as that gives PyInstaller undue hints that those submodules exist and should be collected (accessing implicitly diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index 1db3b974f..e894b08f6 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -1878,7 +1878,7 @@ typedef void (PyDataMem_EventHookFunc)(void *inp, void *outp, size_t size, /* * The Structures defined in this block are currently considered * private API and may change without warning! - * Part of this (at least the size) is exepcted to be public API without + * Part of this (at least the size) is expected to be public API without * further modifications. */ /* TODO: Make this definition public in the API, as soon as its settled */ diff --git a/numpy/core/src/common/simd/avx2/math.h b/numpy/core/src/common/simd/avx2/math.h index 5c869f911..1ef9cd36a 100644 --- a/numpy/core/src/common/simd/avx2/math.h +++ b/numpy/core/src/common/simd/avx2/math.h @@ -234,7 +234,7 @@ NPY_IMPL_AVX256_REDUCE_MINMAX(npy_uint, max_u, max_epu) NPY_IMPL_AVX256_REDUCE_MINMAX(npy_int, max_s, max_epi) #undef NPY_IMPL_AVX256_REDUCE_MINMAX -// round to nearest intger even +// round to nearest integer even #define npyv_rint_f32(A) _mm256_round_ps(A, _MM_FROUND_TO_NEAREST_INT) #define npyv_rint_f64(A) _mm256_round_pd(A, _MM_FROUND_TO_NEAREST_INT) diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index f06875cae..57c3037dc 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -391,7 +391,7 @@ static int temp.imag = (@ftype@) oop.imag; #if NPY_SIZEOF_@NAME@ < NPY_SIZEOF_CDOUBLE /* really just float... */ - /* Overflow could have occured converting double to float */ + /* Overflow could have occurred converting double to float */ if (NPY_UNLIKELY((npy_isinf(temp.real) && !npy_isinf(oop.real)) || (npy_isinf(temp.imag) && !npy_isinf(oop.imag)))) { if (PyUFunc_GiveFloatingpointErrors("cast", NPY_FPE_OVERFLOW) < 0) { diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c index adbfb22e7..bcc9f4e94 100644 --- a/numpy/core/src/multiarray/flagsobject.c +++ b/numpy/core/src/multiarray/flagsobject.c @@ -109,7 +109,7 @@ PyArray_UpdateFlags(PyArrayObject *ret, int flagmask) * a single element). * We correct this, however. When a dimension has length 1, its stride is * never used and thus has no effect on the memory layout. - * The above rules thus only apply when ignorning all size 1 dimenions. + * The above rules thus only apply when ignoring all size 1 dimensions. */ static void _UpdateContiguousFlags(PyArrayObject *ap) diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c index a3c9e986b..76403df25 100644 --- a/numpy/core/src/multiarray/hashdescr.c +++ b/numpy/core/src/multiarray/hashdescr.c @@ -85,7 +85,7 @@ static int _array_descr_builtin(PyArray_Descr* descr, PyObject *l) item = PyTuple_GetItem(t, i); if (item == NULL) { PyErr_SetString(PyExc_SystemError, - "(Hash) Error while computing builting hash"); + "(Hash) Error while computing builtin hash"); goto clean_t; } PyList_Append(l, item); diff --git a/numpy/core/src/multiarray/textreading/conversions.c b/numpy/core/src/multiarray/textreading/conversions.c index 11f4210f7..7fa96dc5e 100644 --- a/numpy/core/src/multiarray/textreading/conversions.c +++ b/numpy/core/src/multiarray/textreading/conversions.c @@ -99,7 +99,7 @@ double_from_ucs4( } if (strip_whitespace) { - /* and then skip any remainig whitespace: */ + /* and then skip any remaining whitespace: */ while (Py_UNICODE_ISSPACE(*end)) { end++; } diff --git a/numpy/core/src/multiarray/textreading/field_types.h b/numpy/core/src/multiarray/textreading/field_types.h index f26e00a5e..d335a3665 100644 --- a/numpy/core/src/multiarray/textreading/field_types.h +++ b/numpy/core/src/multiarray/textreading/field_types.h @@ -31,7 +31,7 @@ * considered boolean True or False). * * TODO: Aside from nailing down the above notes, it may be nice to expose - * these function publically. This could allow user DTypes to provide + * these function publicly. This could allow user DTypes to provide * a converter or custom converters written in C rather than Python. * * @param descr The NumPy descriptor of the field (may be byte-swapped, etc.) diff --git a/numpy/core/src/multiarray/textreading/rows.c b/numpy/core/src/multiarray/textreading/rows.c index a72fb79d9..ce68b8bee 100644 --- a/numpy/core/src/multiarray/textreading/rows.c +++ b/numpy/core/src/multiarray/textreading/rows.c @@ -19,7 +19,7 @@ #include "textreading/growth.h" /* - * Minimum size to grow the allcoation by (or 25%). The 8KiB means the actual + * Minimum size to grow the allocation by (or 25%). The 8KiB means the actual * growths is within `8 KiB <= size < 16 KiB` (depending on the row size). */ #define MIN_BLOCK_SIZE (1 << 13) diff --git a/numpy/core/src/npysort/x86-qsort.dispatch.cpp b/numpy/core/src/npysort/x86-qsort.dispatch.cpp index 39c24d522..8e88cc667 100644 --- a/numpy/core/src/npysort/x86-qsort.dispatch.cpp +++ b/numpy/core/src/npysort/x86-qsort.dispatch.cpp @@ -637,7 +637,7 @@ get_pivot(type_t *arr, const npy_intp left, const npy_intp right) } /* - * Parition one ZMM register based on the pivot and returns the index of the + * Partition one ZMM register based on the pivot and returns the index of the * last element that is less than equal to the pivot. */ template <typename vtype, typename type_t, typename zmm_t> @@ -657,7 +657,7 @@ partition_vec(type_t *arr, npy_intp left, npy_intp right, const zmm_t curr_vec, } /* - * Parition an array based on the pivot and returns the index of the + * Partition an array based on the pivot and returns the index of the * last element that is less than equal to the pivot. */ template <typename vtype, typename type_t> @@ -746,7 +746,7 @@ static inline void qsort_(type_t *arr, npy_intp left, npy_intp right, npy_int max_iters) { /* - * Resort to heapsort if quicksort isnt making any progress + * Resort to heapsort if quicksort isn't making any progress */ if (max_iters <= 0) { heapsort_<typename vtype::tag>(arr + left, right + 1 - left); diff --git a/numpy/core/src/umath/loops_hyperbolic.dispatch.c.src b/numpy/core/src/umath/loops_hyperbolic.dispatch.c.src index fbe68aefb..8e09de941 100644 --- a/numpy/core/src/umath/loops_hyperbolic.dispatch.c.src +++ b/numpy/core/src/umath/loops_hyperbolic.dispatch.c.src @@ -38,7 +38,7 @@ * * ALGORITHM DETAILS * - * SVML handel |x| > HUGE_THRESHOLD, INF and NaNs by scalar callout as following: + * SVML handle |x| > HUGE_THRESHOLD, INF and NaNs by scalar callout as following: * 1. check special cases * 2. return `+-1` for `|x| > HUGE_THRESHOLD` otherwise return `x` * diff --git a/numpy/core/src/umath/scalarmath.c.src b/numpy/core/src/umath/scalarmath.c.src index e50032bc0..7bfa29d7e 100644 --- a/numpy/core/src/umath/scalarmath.c.src +++ b/numpy/core/src/umath/scalarmath.c.src @@ -792,7 +792,7 @@ typedef enum { */ CONVERSION_SUCCESS, /* - * Other object is an unkown scalar or array-like, we (typically) use + * Other object is an unknown scalar or array-like, we (typically) use * the generic path, which normally ends up in the ufunc machinery. */ OTHER_IS_UNKNOWN_OBJECT, diff --git a/numpy/core/tests/test_array_interface.py b/numpy/core/tests/test_array_interface.py index 72670ed8d..8b1ab27c5 100644 --- a/numpy/core/tests/test_array_interface.py +++ b/numpy/core/tests/test_array_interface.py @@ -136,7 +136,7 @@ def test_cstruct(get_module): This class is for testing the timing of the PyCapsule destructor invoked when numpy release its reference to the shared data as part of the numpy array interface protocol. If the PyCapsule destructor is - called early the shared data is freed and invlaid memory accesses will + called early the shared data is freed and invalid memory accesses will occur. """ diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 87317cc92..e27a39c3a 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -4614,7 +4614,7 @@ class TestArgmax: ([np.nan, 0, 1, 2, 3], 0), ([np.nan, 0, np.nan, 2, 3], 0), # To hit the tail of SIMD multi-level(x4, x1) inner loops - # on varient SIMD widthes + # on variant SIMD widthes ([1] * (2*5-1) + [np.nan], 2*5-1), ([1] * (4*5-1) + [np.nan], 4*5-1), ([1] * (8*5-1) + [np.nan], 8*5-1), @@ -4757,7 +4757,7 @@ class TestArgmin: ([np.nan, 0, 1, 2, 3], 0), ([np.nan, 0, np.nan, 2, 3], 0), # To hit the tail of SIMD multi-level(x4, x1) inner loops - # on varient SIMD widthes + # on variant SIMD widthes ([1] * (2*5-1) + [np.nan], 2*5-1), ([1] * (4*5-1) + [np.nan], 4*5-1), ([1] * (8*5-1) + [np.nan], 8*5-1), diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py index 3830ec0c7..c5150d41b 100644 --- a/numpy/core/tests/test_scalarmath.py +++ b/numpy/core/tests/test_scalarmath.py @@ -804,7 +804,7 @@ class TestHash: assert hash(val) == hash(numpy_val) if hash(float(np.nan)) != hash(float(np.nan)): - # If Python distinguises different NaNs we do so too (gh-18833) + # If Python distinguishes different NaNs we do so too (gh-18833) assert hash(scalar(np.nan)) != hash(scalar(np.nan)) @pytest.mark.parametrize("type_code", np.typecodes['Complex']) diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index afe42b56a..912d4132c 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -288,11 +288,11 @@ class TestComparisons: # Sequence: Binary, Scalar1 and Scalar2 assert_(comp_b.tolist() == comp_b_list, - f"Failed comparision ({py_comp.__name__})") + f"Failed comparison ({py_comp.__name__})") assert_(comp_s1.tolist() == comp_s1_list, - f"Failed comparision ({py_comp.__name__})") + f"Failed comparison ({py_comp.__name__})") assert_(comp_s2.tolist() == comp_s2_list, - f"Failed comparision ({py_comp.__name__})") + f"Failed comparison ({py_comp.__name__})") def test_ignore_object_identity_in_equal(self): # Check comparing identical objects whose comparison diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c index 8282655e5..add6e8b6e 100644 --- a/numpy/f2py/src/fortranobject.c +++ b/numpy/f2py/src/fortranobject.c @@ -795,7 +795,7 @@ static int get_elsize(PyObject *obj) { /* get_elsize determines array itemsize from a Python object. Returns - elsize if succesful, -1 otherwise. + elsize if successful, -1 otherwise. Supported types of the input are: numpy.ndarray, bytes, str, tuple, list. diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index dde48ccae..0756cc646 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -2495,7 +2495,7 @@ M 33 21.99 @pytest.mark.parametrize("ndim", [0, 1, 2]) def test_ndmin_keyword(self, ndim: int): - # lets have the same behaivour of ndmin as loadtxt + # lets have the same behaviour of ndmin as loadtxt # as they should be the same for non-missing values txt = "42" diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx index 6af101ed9..aaf51b385 100644 --- a/numpy/random/_generator.pyx +++ b/numpy/random/_generator.pyx @@ -3014,7 +3014,7 @@ cdef class Generator: intermediate distribution exceeding the max acceptable value of the ``Generator.poisson`` method. This happens when :math:`p` is too low (a lot of failures happen for every success) and :math:`n` is too big ( - a lot of sucesses are allowed). + a lot of successes are allowed). Therefore, the :math:`n` and :math:`p` values must satisfy the constraint: .. math:: n\\frac{1-p}{p}+10n\\sqrt{n}\\frac{1-p}{p}<2^{63}-1-10\\sqrt{2^{63}-1}, @@ -4433,7 +4433,7 @@ cdef class Generator: is shuffled independently of the others. If `axis` is None, the flattened array is shuffled. out : ndarray, optional - If given, this is the destinaton of the shuffled array. + If given, this is the destination of the shuffled array. If `out` is None, a shuffled copy of the array is returned. Returns |