MAINT: fix typos by musvaage · Pull Request #27344 · numpy/numpy · GitHub
Skip to content
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 .spin/cmds.py
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/bench_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def setup(self, num_lines):
# unfortunately, timeit will only run setup()
# between repeat events, but not for iterations
# within repeats, so the StringIO object
# will have to be rewinded in the benchmark proper
# will have to be rewound in the benchmark proper
self.data_comments = StringIO('\n'.join(data))

def time_comment_loadtxt_csv(self, num_lines):
Expand Down
2 changes: 1 addition & 1 deletion doc/neps/nep-0021-advanced-indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ eventualities.
Copyright
---------

This document is placed under the CC0 1.0 Universell (CC0 1.0) Public Domain Dedication [1]_.
This document is placed under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication [1]_.


References and footnotes
Expand Down
2 changes: 1 addition & 1 deletion doc/neps/nep-0048-spending-project-funds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ a volunteer in a reasonable amount of time.
There are also many tasks, activities, and projects outside of
development work that are important and could enhance the project or community
- think of, for example, user surveys, translations, outreach, dedicated
mentoring of newcomers, community organizating, website improvements, and
mentoring of newcomers, community organizing, website improvements, and
administrative tasks.

Time of people to perform tasks is also not the only thing that funds can be
Expand Down
2 changes: 1 addition & 1 deletion doc/neps/nep-0053-c-abi-evolution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ a user to:
yet compatible.

The import of ``numpy2_compat`` (and an error when it is missing) will be
inserted by the NumPy eaders as part of the ``import_array()`` call.
inserted by the NumPy headers as part of the ``import_array()`` call.

Alternatives
============
Expand Down
2 changes: 1 addition & 1 deletion doc/source/f2py/f2py-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class present in ``util.py``.

This class many helper functions for parsing and compiling test source files. Its child
classes can override its ``sources`` data member to provide their own source files.
This superclass will then compile the added source files upon object creation andtheir
This superclass will then compile the added source files upon object creation and their
functions will be appended to ``self.module`` data member. Thus, the child classes will
be able to access the fortran functions specified in source file by calling
``self.module.[fortran_function_name]``.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/c-api/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ of this useful approach to looping over an array from C.

.. c:function:: void PyArray_ITER_NEXT(PyObject* iterator)

Incremement the index and the dataptr members of the *iterator* to
Increment the index and the dataptr members of the *iterator* to
point to the next element of the array. If the array is not
(C-style) contiguous, also increment the N-dimensional coordinates
array.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/c-api/datetimes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Conversion functions

Returns the string length to use for converting datetime
objects with the given local time and unit settings to strings.
Use this when constructings strings to supply to
Use this when constructing strings to supply to
``NpyDatetime_MakeISO8601Datetime``.

.. c:function:: int NpyDatetime_MakeISO8601Datetime(\
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/simd/build-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Behaviors
# is equivalent to
python -m build --wheel -Csetup-args=-Dcpu-baseline="sse sse2 sse3 ssse3 sse41 popcnt sse42"

- ``cpu-dispatch`` does not combain any of implied CPU features,
- ``cpu-dispatch`` does not combine any of implied CPU features,
so you must add them unless you want to disable one or all of them::

# Only dispatches AVX2 and FMA3
Expand Down
4 changes: 2 additions & 2 deletions doc/source/reference/simd/how-it-works.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ through ``--cpu-dispatch``, but it can also represent other options such as:
#define NPY__CPU_TARGET_AVX2
#define NPY__CPU_TARGET_AVX512F
// our dispatch-able source
#include "/the/absuolate/path/of/hello.dispatch.c"
#include "/the/absolute/path/of/hello.dispatch.c"

- **(D) Dispatch-able configuration header**: The infrastructure
generates a config header for each dispatch-able source, this header
Expand Down Expand Up @@ -234,7 +234,7 @@ through ``--cpu-dispatch``, but it can also represent other options such as:
// the additional optimizations, so it could be SSE42 or AVX512F
#define CURRENT_TARGET(X) NPY_CAT(NPY_CAT(X, _), NPY__CPU_TARGET_CURRENT)
#endif
// Macro 'CURRENT_TARGET' adding the current target as suffux to the exported symbols,
// Macro 'CURRENT_TARGET' adding the current target as suffix to the exported symbols,
// to avoid linking duplications, NumPy already has a macro called
// 'NPY_CPU_DISPATCH_CURFX' similar to it, located at
// numpy/numpy/_core/src/common/npy_cpu_dispatch.h
Expand Down
2 changes: 1 addition & 1 deletion doc/source/release/1.10.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ New Features
Reading extra flags from site.cfg
---------------------------------
Previously customization of compilation of dependency libraries and numpy
itself was only accomblishable via code changes in the distutils package.
itself was only accomplishable via code changes in the distutils package.
Now numpy.distutils reads in the following extra flags from each group of the
*site.cfg*:

Expand Down
2 changes: 1 addition & 1 deletion doc/source/user/basics.creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ you create the array.
===========================================

..
40 functions seems like a small number, but the routies.array-creation
40 functions seems like a small number, but the routines.array-creation
has ~47. I'm sure there are more.

NumPy has over 40 built-in functions for creating arrays as laid
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user/c-info.python-as-glue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ file that defines the interface. Often, however, this ``.i`` file can
be parts of the header itself. The interface usually needs a bit of
tweaking to be very useful. This ability to parse C/C++ headers and
auto-generate the interface still makes SWIG a useful approach to
adding functionalilty from C/C++ into Python, despite the other
adding functionality from C/C++ into Python, despite the other
methods that have emerged that are more targeted to Python. SWIG can
actually target extensions for several languages, but the typemaps
usually have to be language-specific. Nonetheless, with modifications
Expand Down
2 changes: 1 addition & 1 deletion numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ class dtype(Generic[_DTypeScalar_co]):
metadata: dict[str, Any] = ...,
) -> dtype[int_ | np.bool]: ...
# NOTE: `_: type[float]` also accepts `type[float | int | bool]`
# NOTE: `float64` inheritcs from `float` at runtime; but this isn't
# NOTE: `float64` inherits from `float` at runtime; but this isn't
# reflected in these stubs. So an explicit `float64` is required here.
@overload
def __new__(
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/_add_newdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5741,7 +5741,7 @@
>>> np.add.resolve_dtypes((float32, float, None))
(dtype('float32'), dtype('float32'), dtype('float32'))

Where the Python ``float`` behaves samilar to a Python value ``0.0``
Where the Python ``float`` behaves similar to a Python value ``0.0``
in a ufunc call. (See :ref:`NEP 50 <NEP50>` for details.)

"""))
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/_machar.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, float_conv=float,int_conv=int,

"""
# We ignore all errors here because we are purposely triggering
# underflow to detect the properties of the runninng arch.
# underflow to detect the properties of the running arch.
with errstate(under='ignore'):
self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)

Expand Down
4 changes: 2 additions & 2 deletions numpy/_core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -4027,7 +4027,7 @@ def std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue, *,

\sqrt{\frac{\sum_i{|a_i - \bar{a}|^2 }}{N - 1}}

In statistics, the resulting quantity is sometimed called the "sample
In statistics, the resulting quantity is sometimes called the "sample
standard deviation" because if `a` is a random sample from a larger
population, this calculation provides the square root of an unbiased
estimate of the variance of the population. The use of :math:`N-1` in the
Expand Down Expand Up @@ -4232,7 +4232,7 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue, *,

\frac{\sum_i{|a_i - \bar{a}|^2}}{N - 1}

In statistics, the resulting quantity is sometimed called the "sample
In statistics, the resulting quantity is sometimes called the "sample
variance" because if `a` is a random sample from a larger population,
this calculation provides an unbiased estimate of the variance of the
population. The use of :math:`N-1` in the denominator is often called
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/common/dlpack/dlpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ typedef enum {
*/
kDLCUDAManaged = 13,
/*!
* \brief Unified shared memory allocated on a oneAPI non-partititioned
* \brief Unified shared memory allocated on a oneAPI non-partitioned
* device. Call to oneAPI runtime is required to determine the device
* type, the USM allocation type and the sycl context it is bound to.
*
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/common/npy_cpu_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ npy__cpu_init_features(void)
{
/*
* just in case if the compiler doesn't respect ANSI
* but for knowing platforms it still nessecery, because @npy__cpu_init_features
* but for knowing platforms it still necessary, because @npy__cpu_init_features
* may called multiple of times and we need to clear the disabled features by
* ENV Var or maybe in the future we can support other methods like
* global variables, go back to @npy__cpu_try_disable_env for more understanding
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/common/numpyos.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ fix_ascii_format(char* buf, size_t buflen, int decimal)
* - format: The printf()-style format to use for the code to use for
* converting.
* - value: The value to convert
* - decimal: if != 0, always has a decimal, and at leasat one digit after
* - decimal: if != 0, always has a decimal, and at least one digit after
* the decimal. This has the same effect as passing 'Z' in the original
* PyOS_ascii_formatd
*
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/multiarray/abstractdtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ npy_update_operand_for_scalar(
else if (NPY_UNLIKELY(casting == NPY_EQUIV_CASTING) &&
descr->type_num != NPY_OBJECT) {
/*
* increadibly niche, but users could pass equiv casting and we
* incredibly niche, but users could pass equiv casting and we
* actually need to cast. Let object pass (technically correct) but
* in all other cases, we don't technically consider equivalent.
* NOTE(seberg): I don't think we should be beholden to this logic.
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/multiarray/dtypemeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ typedef struct {
PyObject *castingimpls;

/*
* Storage for `descr->f`, since we may need to allow some customizatoin
* Storage for `descr->f`, since we may need to allow some customization
* here at least in a transition period and we need to set it on every
* dtype instance for backward compatibility. (Keep this at end)
*/
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/npysort/selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ unguarded_partition_(type *v, npy_intp *tosort, const type pivot, npy_intp *ll,
/*
* select median of median of blocks of 5
* if used as partition pivot it splits the range into at least 30%/70%
* allowing linear time worstcase quickselect
* allowing linear time worst-case quickselect
*/
template <typename Tag, bool arg, typename type>
static npy_intp
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/umath/fast_loop_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ abs_ptrdiff(char *a, char *b)
/*
* stride is equal to element size and input and destination are equal or
* don't overlap within one register. The check of the steps against
* esize also quarantees that steps are >= 0.
* esize also guarantees that steps are >= 0.
*/
#define IS_BLOCKABLE_UNARY(esize, vsize) \
(steps[0] == (esize) && steps[0] == steps[1] && \
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/umath/loops_arithm_fp.dispatch.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* current one kinda slow and it can be optimized by
* at least avoiding the division and keep sqrt.
* - Vectorize reductions
* - Add support for ASIMD/VCMLA through universal intrinics.
* - Add support for ASIMD/VCMLA through universal intrinsics.
*/

//###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/umath/scalarmath.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ convert_to_@name@(PyObject *value, @type@ *result, npy_bool *may_need_deferring)
if (PyArray_IsScalar(value, @Name@)) {
*result = PyArrayScalar_VAL(value, @Name@);
/*
* In principle special, assyemetric, handling could be possible for
* In principle special, asymmetric, handling could be possible for
* explicit subclasses.
* In practice, we just check the normal deferring logic.
*/
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3005,7 +3005,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
const char *ufunc_name = ufunc_get_name_cstr(ufunc);
char *opname = "reduceat";

/* These parameters comefrom a TLS global */
/* These parameters come from a TLS global */
int buffersize = 0, errormask = 0;

NPY_BEGIN_THREADS_DEF;
Expand Down
4 changes: 2 additions & 2 deletions numpy/_core/tests/test_arrayprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_self_containing(self):
first[()] = 0 # resolve circular references for garbage collector

def test_containing_list(self):
# printing square brackets directly would be ambiguuous
# printing square brackets directly would be ambiguous
arr1d = np.array([None, None])
arr1d[0] = [1, 2]
arr1d[1] = [3]
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def test_ctx_mgr(self):
assert_equal(s, '[0.67]')

def test_ctx_mgr_restores(self):
# test that print options are actually restrored
# test that print options are actually restored
opts = np.get_printoptions()
with np.printoptions(precision=opts['precision'] - 1,
linewidth=opts['linewidth'] - 4):
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_casting_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def test_structured_field_offsets(self, to_dt, expected_off):
# completely invalid/impossible cast:
("i,i", "i,i,i", None),
])
def test_structured_view_offsets_paramteric(
def test_structured_view_offsets_parametric(
self, from_dt, to_dt, expected_off):
# TODO: While this test is fairly thorough, right now, it does not
# really test some paths that may have nonzero offsets (they don't
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ def test_float_int_pyscalar_promote_rational(self, other, expected):
])
def test_permutations_do_not_influence_result(self, dtypes, expected):
# Tests that most permutations do not influence the result. In the
# above some uint and int combintations promote to a larger integer
# above some uint and int combinations promote to a larger integer
# type, which would then promote to a larger than necessary float.
for perm in permutations(dtypes):
assert np.result_type(*perm) == expected
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_einsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def test_broadcasting_dot_cases(self):

def test_output_order(self):
# Ensure output order is respected for optimize cases, the below
# conraction should yield a reshaped tensor view
# contraction should yield a reshaped tensor view
# gh-16415

a = np.ones((2, 3, 5), order='F')
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_trivial_fancy_not_possible(self):
assert_array_equal(a[idx], idx)

# this case must not go into the fast path, note that idx is
# a non-contiuguous none 1D array here.
# a non-contiguous none 1D array here.
a[idx] = -1
res = np.arange(6)
res[0] = -1
Expand Down
4 changes: 2 additions & 2 deletions numpy/_core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -4767,7 +4767,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 variant SIMD widthes
# on variant SIMD widths
([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),
Expand Down Expand Up @@ -4910,7 +4910,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 variant SIMD widthes
# on variant SIMD widths
([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),
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_scalarmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ def test_scalar_matches_array_op_with_pyscalar(op, sctype, other_type, rop):
assert res == expected
if isinstance(val1, float) and other_type is complex and rop:
# Python complex accepts float subclasses, so we don't get a chance
# and the result may be a Python complelx (thus, the `np.array()``)
# and the result may be a Python complex (thus, the `np.array()``)
assert np.array(res).dtype == expected.dtype
else:
assert res.dtype == expected.dtype
2 changes: 1 addition & 1 deletion numpy/_typing/_dtype_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def dtype(self) -> _DType_co: ...

# NOTE: while it is possible to provide the dtype as a dict of
# dtype-like objects (e.g. `{'field1': ..., 'field2': ..., ...}`),
# this syntax is officially discourged and
# this syntax is officially discouraged and
# therefore not included in the type-union defining `DTypeLike`.
#
# See https://github.com/numpy/numpy/issues/16891 for more details.
Expand Down
4 changes: 2 additions & 2 deletions numpy/distutils/command/config_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def initialize_options(self):
self.noarch = None

def finalize_options(self):
log.info('unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options')
log.info('unifying config_fc, config, build_clib, build_ext, build commands --fcompiler options')
build_clib = self.get_finalized_command('build_clib')
build_ext = self.get_finalized_command('build_ext')
config = self.get_finalized_command('config')
Expand Down Expand Up @@ -98,7 +98,7 @@ def initialize_options(self):
self.compiler = None

def finalize_options(self):
log.info('unifing config_cc, config, build_clib, build_ext, build commands --compiler options')
log.info('unifying config_cc, config, build_clib, build_ext, build commands --compiler options')
build_clib = self.get_finalized_command('build_clib')
build_ext = self.get_finalized_command('build_ext')
config = self.get_finalized_command('config')
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/exec_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _quote_arg(arg):
"""
Quote the argument for safe use in a shell command line.
"""
# If there is a quote in the string, assume relevants parts of the
# If there is a quote in the string, assume relevant parts of the
# string are already quoted (e.g. '-I"C:\\Program Files\\..."')
if '"' not in arg and ' ' in arg:
return '"%s"' % arg
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/mingw32ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def find_python_dll():
# - find it in the virtualenv (sys.prefix)
# - find it in python main dir (sys.base_prefix, if in a virtualenv)
# - in system32,
# - ortherwise (Sxs), I don't know how to get it.
# - otherwise (Sxs), I don't know how to get it.
stems = [sys.prefix]
if sys.base_prefix != sys.prefix:
stems.append(sys.base_prefix)
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/tests/test_build_ext.py
Loading