Skip to content

Commit

Permalink
Fix various typos
Browse files Browse the repository at this point in the history
Found via `codespell -q 3 -S CHANGE_LOG -L acount,arry,asscii,ba,breal,documen,hge,inout,larg,nd,nin,splitted,te,tunnell,warmup,withs,wth`
  • Loading branch information
luzpaz committed Jun 22, 2022
1 parent 9a7820c commit a449993
Show file tree
Hide file tree
Showing 69 changed files with 101 additions and 102 deletions.
2 changes: 1 addition & 1 deletion buildscripts/condarecipe.local/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Numba/llvmlite stack needs an older compiler for backwards compatability.
# Numba/llvmlite stack needs an older compiler for backwards compatibility.
c_compiler_version: # [linux]
- 7 # [linux and (x86_64 or ppc64le)]
- 9 # [linux and aarch64]
Expand Down
2 changes: 1 addition & 1 deletion docs/dagmap/jquery.graphviz.svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
animation: false,
viewport: null
}).on('hide.bs.tooltip', function() {
// keep them visible even if you acidentally mouse over
// keep them visible even if you accidentally mouse over
if ($a.attr('data-tooltip-keepvisible')) {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_ext/ghfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def ghfile_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
node = nodes.reference(rawtext, text, refuri=make_ref(text), **options)
my_nodes.append(node)

# insert seperators if needed
# insert separators if needed
if len(my_nodes) > 1:
my_nodes = intersperse(my_nodes, nodes.Text(" | "))
return my_nodes, []
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cuda/external-memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ implementation follows:
is handled internally within Numba.
- It is optional to provide memory info from the ``get_memory_info`` method, which
provides a count of the total and free memory on the device for the context.
It is preferrable to implement the method, but this may not be practical for
It is preferable to implement the method, but this may not be practical for
all allocators. If memory info is not provided, this method should raise a
:class:`RuntimeError`.
- The ``defer_cleanup`` method should return a context manager that ensures that
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ circumstances should ``type: ignore`` comments be used.

If you are contributing a new feature, we encourage you to use type hints, even if the file is not currently in the
checklist. If you want to contribute type hints to enable a new file to be in the checklist, please add the file to the
``files`` variable in ``mypy.ini``, and decide what level of compliance you are targetting. Level 3 is basic static
``files`` variable in ``mypy.ini``, and decide what level of compliance you are targeting. Level 3 is basic static
checks, while levels 2 and 1 represent stricter checking. The levels are described in details in ``mypy.ini``.

There is potential for confusion between the Numba module ``typing`` and Python built-in module ``typing`` used for type
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer/hashing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The accommodation of ``PYTHONHASHSEED``
---------------------------------------

The ``PYTHONHASHSEED`` environment variable can be used to seed the CPython
hashing algorithms for e.g. the purposes of reproduciblity. The Numba hashing
hashing algorithms for e.g. the purposes of reproducibility. The Numba hashing
implementation directly reads the CPython hashing algorithms' internal state and
as a result the influence of ``PYTHONHASHSEED`` is replicated in Numba's
hashing implementations.
2 changes: 1 addition & 1 deletion docs/source/developer/literal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Notes on Literal Types
some limitations of the compilation mechanism relating to types.

Some features need to specialize based on the literal value during
compliation to produce type stable code necessary for successful compilation in
compilation to produce type stable code necessary for successful compilation in
Numba. This can be achieved by propagating the literal value through the type
system. Numba recognizes inline literal values as :class:`numba.types.Literal`.
For example::
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer/repomap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@ Note that the CUDA target does reuse some parts of the CPU target.
- :ghfile:`numba/cuda/compiler.py` - Compiler pipeline for CUDA target
- :ghfile:`numba/cuda/intrinsic_wrapper.py` - CUDA device intrinsics
(shuffle, ballot, etc)
- :ghfile:`numba/cuda/initialize.py` - Defered initialization of the CUDA
- :ghfile:`numba/cuda/initialize.py` - Deferred initialization of the CUDA
device and subsystem. Called only when user imports ``numba.cuda``
- :ghfile:`numba/cuda/simulator_init.py` - Initalizes the CUDA simulator
- :ghfile:`numba/cuda/simulator_init.py` - Initializes the CUDA simulator
subsystem (only when user requests it with env var)
- :ghfile:`numba/cuda/random.py` - Implementation of random number generator
- :ghfile:`numba/cuda/api.py` - User facing APIs imported into ``numba.cuda.*``
Expand Down
6 changes: 3 additions & 3 deletions docs/source/proposals/jit-classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ With these operations, a class object (not the instance) does not need to be
materialize. Using the class object as a constructor is fully resolved (a
runtime implementation is picked) during the typing phase in the compiler.
This means **a class object will not be first class**. On the other hand,
implementating a first-class class object will require an
"interface" type, or the type of class.
implementing a first-class class object will require an "interface" type,
or the type of class.

The instantiation of a class will allocate resources for storing the data
attributes. This is described in the "Storage model" section. Methods are
Expand Down Expand Up @@ -69,7 +69,7 @@ C structure::
complex64 field2;
};

This will also be comptabile with an aligned NumPy structured dtype.
This will also be compatible with an aligned numpy structure dtype.


Methods
Expand Down
4 changes: 2 additions & 2 deletions docs/source/proposals/typing_recursion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This document proposes an enhancement to the type inference algorithm to
support recursion without explicitly annotating the function signature.
As a result, the proposal enables numba to type-infer both self-recursive and
mutual-recursive functions under some limitations. In practice, these
limitions can be easily overcome by specifying a compilation order.
limitations can be easily overcome by specifying a compilation order.


The Current State
Expand All @@ -38,7 +38,7 @@ which in turns call ``foo()``::
return foo(x - 1)


The type inferrence process of ``foo()`` depends on that of ``bar()``,
The type inference process of ``foo()`` depends on that of ``bar()``,
which depends on ``foo()``. Therefore ``foo()`` depends on itself and the type
inference algorithm cannot terminate.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/envvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ These variables influence what is printed out during compilation of

- ``"old_style"`` (default): this is the exception handling behaviour that
is present in Numba versions <= 0.54.x. Numba will capture and wrap all
errors occuring in compilation and depending on the compilation phase they
errors occurring in compilation and depending on the compilation phase they
will likely materialize as part of the message in a ``TypingError`` or a
``LoweringError``.
- ``"new_style"`` this will treat any exception that does not inherit from
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ A more radical alternative is :ref:`ahead-of-time compilation <pycc>`.
GPU Programming
===============

How do I work around the ``CUDA intialized before forking`` error?
How do I work around the ``CUDA initialized before forking`` error?
------------------------------------------------------------------

On Linux, the ``multiprocessing`` module in the Python standard library
Expand All @@ -298,7 +298,7 @@ available GPUs before starting the process pool. In Python 3, you can change
the process start method, as described in the `multiprocessing documentation
<https://docs.python.org/3.9/library/multiprocessing.html#contexts-and-start-methods>`_.
Switching from ``fork`` to ``spawn`` or ``forkserver`` will avoid the CUDA
initalization issue, although the child processes will not inherit any global
initialization issue, although the child processes will not inherit any global
variables from their parent.


Expand Down
2 changes: 1 addition & 1 deletion docs/source/user/troubleshoot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ In order to debug code, it is possible to disable JIT compilation, which makes
the ``jit`` decorator (and the ``njit`` decorator) act as if
they perform no operation, and the invocation of decorated functions calls the
original Python function instead of a compiled version. This can be toggled by
setting the :envvar:`NUMBA_DISABLE_JIT` enviroment variable to ``1``.
setting the :envvar:`NUMBA_DISABLE_JIT` environment variable to ``1``.

When this mode is enabled, the ``vectorize`` and ``guvectorize`` decorators will
still result in compilation of a ufunc, as there is no straightforward pure
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ files = **/numba/core/types/*.py, **/numba/core/datamodel/*.py, **/numba/core/re
;follow_imports = normal

# Level 3 - modules that pass mypy default settings (only those in `files` global setting and not in previous levels)
# Function/variables are annotated to avoid mypy erros, but annotations are not complete.
# Function/variables are annotated to avoid mypy errors, but annotations are not complete.
[mypy-numba.core.*]
warn_return_any = True

Expand Down
4 changes: 2 additions & 2 deletions numba/cext/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ numba_list_delete_slice(NB_List *lp,
lp->methods.item_decref(loc);
}
}
// memove items into place
// memmove items into place
leftover_bytes = (lp->size - stop) * lp->item_size;
loc = lp->items + lp->item_size * start;
new_loc = lp->items + lp->item_size * stop;
Expand Down Expand Up @@ -538,7 +538,7 @@ numba_list_delete_slice(NB_List *lp,
// decref item being removed
loc = lp->items + lp->item_size * cur;
list_decref_item(lp, loc);
/* memmove the aforementiond step-1 (or less) items
/* memmove the aforementioned step-1 (or less) items
* dst : index of deleted item minus total deleted sofar
* src : index of deleted item plus one (next item)
*/
Expand Down
2 changes: 1 addition & 1 deletion numba/cloudpickle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import

# NOTE: The following imports are adapted to use as a vendored subpackge.
# NOTE: The following imports are adapted to use as a vendored subpackage.
# from https://github.com/cloudpipe/cloudpickle/blob/d3279a0689b769d5315fc6ff00cd0f5897844526/cloudpickle/init.py
from .cloudpickle import * # noqa
from .cloudpickle_fast import CloudPickler, dumps, dump # noqa
Expand Down
6 changes: 3 additions & 3 deletions numba/cloudpickle/cloudpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def g():
DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL

# Track the provenance of reconstructed dynamic classes to make it possible to
# recontruct instances from the matching singleton class definition when
# reconstruct instances from the matching singleton class definition when
# appropriate and preserve the usual "isinstance" semantics of Python objects.
_DYNAMIC_CLASS_TRACKER_BY_CLASS = weakref.WeakKeyDictionary()
_DYNAMIC_CLASS_TRACKER_BY_ID = weakref.WeakValueDictionary()
Expand Down Expand Up @@ -242,7 +242,7 @@ def _extract_code_globals(co):
out_names = {names[oparg] for _, oparg in _walk_global_ops(co)}

# Declaring a function inside another one using the "def ..."
# syntax generates a constant code object corresonding to the one
# syntax generates a constant code object corresponding to one
# of the nested function's As the nested function may itself need
# global variables, we need to introspect its code, extract its
# globals, (look for code object in it's co_consts attribute..) and
Expand Down Expand Up @@ -486,7 +486,7 @@ def _create_parametrized_type_hint(origin, args):


def parametrized_type_hint_getinitargs(obj):
# The distorted type check sematic for typing construct becomes:
# The distorted type check semantic for typing construct becomes:
# ``type(obj) is type(TypeHint)``, which means "obj is a
# parametrized TypeHint"
if type(obj) is type(Literal): # pragma: no branch
Expand Down
2 changes: 1 addition & 1 deletion numba/core/boxing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ def object_getattr_safely(obj, attr):
with early_exit_if_null(c.builder, stack, ct_voidptr_ty):
handle_failure()

# This wires in the fnptrs refered to by name
# This wires in the fnptrs referred to by name
def wire_in_fnptrs(name):
# Find the CFunctionType function
interface_next_fn = c.pyapi.object_getattr_string(
Expand Down
2 changes: 1 addition & 1 deletion numba/core/cgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def _setvalue(self, value):

def alloca_once(builder, ty, size=None, name='', zfill=False):
"""Allocate stack memory at the entry block of the current function
pointed by ``builder`` withe llvm type ``ty``. The optional ``size`` arg
pointed by ``builder`` with llvm type ``ty``. The optional ``size`` arg
set the number of element to allocate. The default is 1. The optional
``name`` arg set the symbol name inside the llvm IR for debugging.
If ``zfill`` is set, fill the memory with zeros at the current
Expand Down
2 changes: 1 addition & 1 deletion numba/core/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def init_digraph(name, fname, fontsize):
# when trying to render to pdf
cmax = 200
if len(fname) > cmax:
wstr = (f'CFG output filname "{fname}" exceeds maximum '
wstr = (f'CFG output filename "{fname}" exceeds maximum '
f'supported length, it will be truncated.')
warnings.warn(wstr, NumbaInvalidConfigWarning)
fname = fname[:cmax]
Expand Down
2 changes: 1 addition & 1 deletion numba/core/controlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def dominance_frontier(self):
The dominance frontier _df(N) is the set of all nodes that are
immediate successors to blocks dominanted by N but which aren't
stricly dominanted by N
strictly dominanted by N
"""
return self._df

Expand Down
2 changes: 1 addition & 1 deletion numba/core/datamodel/packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ArgPacker(object):
It maintains a position map for unflattening the arguments.
Since struct (esp. nested struct) have specific ABI requirements (e.g.
alignemnt, pointer address-space, ...) in different architecture (e.g.
alignment, pointer address-space, ...) in different architecture (e.g.
OpenCL, CUDA), flattening composite argument types simplifes the call
setup from the Python side. Functions are receiving simple primitive
types and there are only a handful of these.
Expand Down
4 changes: 2 additions & 2 deletions numba/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def __init__(self, msg, loc=None):

class UnsupportedParforsError(NumbaError):
"""
An error ocurred because parfors is not supported on the platform.
An error ocurrred because parfors is not supported on the platform.
"""
pass

Expand Down Expand Up @@ -673,7 +673,7 @@ def __init__(self, value, loc=None):

class InternalError(NumbaError):
"""
For wrapping internal error occured within the compiler
For wrapping internal error occurred within the compiler
"""

def __init__(self, exception):
Expand Down
2 changes: 1 addition & 1 deletion numba/core/externals.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def compile_multi3(context):
bb = fn.append_basic_block()
builder = ir.IRBuilder(bb)

# This implementation mimicks compiler-rt's.
# This implementation mimics compiler-rt's.
al = builder.trunc(a, i64)
bl = builder.trunc(b, i64)
ah = builder.trunc(builder.ashr(a, _64), i64)
Expand Down
2 changes: 1 addition & 1 deletion numba/core/inline_closurecall.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ def inline_array(array_var, expr, stmts, list_vars, dels):
ir.Expr.build_tuple(items=[size_var], loc=loc), loc))

# The general approach is to create an empty array and then fill
# the elements in one-by-one from their specificiation.
# the elements in one-by-one from their specification.

# Get the numpy type to pass to empty.
nptype = types.DType(dtype)
Expand Down
6 changes: 3 additions & 3 deletions numba/core/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ def _call_function_ex_replace_args_large(
)
search_end -= 1
else:
# There must always be an initial assignement
# There must always be an initial assignment
# https://github.com/numba/numba/blob/59fa2e335be68148b3bd72a29de3ff011430038d/numba/core/interpreter.py#L259-L260
# If this changes we may need to support this branch.
raise AssertionError("unreachable")
# Traverse backwards to find all concatentations
# Traverse backwards to find all concatenations
# until eventually reaching the original empty tuple.
while search_end >= search_start:
concat_stmt = old_body[search_end]
Expand Down Expand Up @@ -415,7 +415,7 @@ def _call_function_ex_replace_args_large(
raise UnsupportedError(errmsg)
lhs_name = concat_stmt.value.lhs.name
rhs_name = concat_stmt.value.rhs.name
# The previous statment should be a
# The previous statement should be a
# build_tuple containing the arg.
arg_tuple_stmt = old_body[search_end - 1]
if not (
Expand Down
2 changes: 1 addition & 1 deletion numba/core/ir_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ def is_namedtuple_class(c):

def fill_block_with_call(newblock, callee, label_next, inputs, outputs):
"""Fill *newblock* to call *callee* with arguments listed in *inputs*.
The returned values are unwraped into variables in *outputs*.
The returned values are unwrapped into variables in *outputs*.
The block would then jump to *label_next*.
"""
scope = newblock.scope
Expand Down
3 changes: 1 addition & 2 deletions numba/core/removerefctpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def remove_unnecessary_nrt_usage(function, context, fndesc):
- call function(s) that return refcounted object.
In effect, the function will not capture or create references that extend
the lifetime of any refcounted objects beyound the lifetime of the
function.
the lifetime of any refcounted objects beyond the lifetime of the function.
The rewrite is performed in place.
If rewrite has happened, this function returns True, otherwise, it returns False.
Expand Down
4 changes: 2 additions & 2 deletions numba/core/runtime/nrtopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
_regex_decref = re.compile(r'\s*(?:tail)?\s*call void @NRT_decref\((.*)\)')
_regex_bb = re.compile(
r'|'.join([
# unamed BB is just a plain number
# unnamed BB is just a plain number
r'[0-9]+:',
# with a proper identifer (see llvm langref)
# with a proper identifier (see llvm langref)
r'[\'"]?[-a-zA-Z$._0-9][-a-zA-Z$._0-9]*[\'"]?:',
# is a start of a function definition
r'^define',
Expand Down
2 changes: 1 addition & 1 deletion numba/core/targetconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class TargetConfig(metaclass=_MetaTargetConfig):
>>> a_bool_option = Option(type=bool, default=False, doc="a bool")
>>> an_int_option = Option(type=int, default=0, doc="an int")
The metaclass will insert properties for each ``Option``. For exapmle:
The metaclass will insert properties for each ``Option``. For example:
>>> tc = MyTargetConfig()
>>> tc.a_bool_option = True # invokes the setter
Expand Down
2 changes: 1 addition & 1 deletion numba/core/typing/cffi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def map_struct_to_record_dtype(cffi_type):
}
is_aligned = True
for k, v in cffi_type.fields:
# guard unsupport values
# guard unsupported values
if v.bitshift != -1:
msg = "field {!r} has bitshift, this is not supported"
raise ValueError(msg.format(k))
Expand Down
2 changes: 1 addition & 1 deletion numba/core/typing/npydecl.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def _parse_nested_sequence(context, typ):
return n + 1, dtype
elif isinstance(typ, (types.BaseTuple,)):
if typ.count == 0:
# Mimick Numpy's behaviour
# Mimic Numpy's behaviour
return 1, types.float64
n, dtype = _parse_nested_sequence(context, typ[0])
dtypes = [dtype]
Expand Down
2 changes: 1 addition & 1 deletion numba/core/typing/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def generic(self, args, kws):
# needs to exist for type resolution

# NOTE: If lowering is failing on a `_EmptyImplementationEntry`,
# the inliner has failed to inline this entry corretly.
# the inliner has failed to inline this entry correctly.
impl_init = _EmptyImplementationEntry('always inlined')
self._compiled_overloads[sig.args] = impl_init
if not self._inline.is_always_inline:
Expand Down
2 changes: 1 addition & 1 deletion numba/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def shutting_down(globals=globals):
# which atexit is True. Some of these finalizers may call shutting_down() to
# check whether the interpreter is shutting down. For this to behave correctly,
# we need to make sure that _at_shutdown is called before the finalizer exit
# function. Since atexit operates as a LIFO stack, we first contruct a dummy
# function. Since atexit operates as a LIFO stack, we first construct a dummy
# finalizer then register atexit to ensure this ordering.
weakref.finalize(lambda: None, lambda: None)
atexit.register(_at_shutdown)
Expand Down
2 changes: 1 addition & 1 deletion numba/cpython/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ def unicode_replace(s, old_str, new_str, count=-1):
thety = count.type

if not isinstance(thety, (int, types.Integer)):
raise TypingError('Unsupported parameters. The parametrs '
raise TypingError('Unsupported parameters. The parameters '
'must be Integer. Given count: {}'.format(count))

if not isinstance(old_str, (types.UnicodeType, types.NoneType)):
Expand Down
Loading

0 comments on commit a449993

Please sign in to comment.