Skip to content

CLN: Enable codespell for all files #51804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
rev: v2.2.2
hooks:
- id: codespell
types_or: [python, rst, markdown]
types_or: [python, rst, markdown, cython, c]
additional_dependencies: [tomli]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.12.5
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/hashing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def hash_object_array(
char **vecs
char *cdata
object val
list datas = []
list data_list = []

k = <bytes>key.encode(encoding)
kb = <uint8_t *>k
Expand Down Expand Up @@ -97,7 +97,7 @@ def hash_object_array(

# keep the references alive through the end of the
# function
datas.append(data)
data_list.append(data)
vecs[i] = cdata

result = np.empty(n, dtype=np.uint64)
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ def maybe_convert_objects(ndarray[object] objects,
seen.object_ = True

if not convert_numeric:
# Note: we count "bool" as numeric here. This is becase
# Note: we count "bool" as numeric here. This is because
# np.array(list_of_items) will convert bools just like it will numeric
# entries.
return objects
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cdef:
cpdef bint check_na_tuples_nonequal(object left, object right):
"""
When we have NA in one of the tuples but not the other we have to check here,
because our regular checks fail before with ambigous boolean value.
because our regular checks fail before with ambiguous boolean value.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/src/parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ char* _str_copy_decimal_str_c(const char *s, char **endpos, char decimal,
double round_trip(const char *p, char **q, char decimal, char sci, char tsep,
int skip_trailing, int *error, int *maybe_int) {
// 'normalize' representation to C-locale; replace decimal with '.' and
// remove t(housand)sep.
// remove thousands separator.
char *endptr;
char *pc = _str_copy_decimal_str_c(p, &endptr, decimal, tsep);
// This is called from a nogil block in parsers.pyx
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/src/ujson/lib/ultrajson.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ typedef struct __JSONObjectEncoder {
size_t *_outLen);

/*
Begin iteration of an iteratable object (JS_ARRAY or JS_OBJECT)
Begin iteration of an iterable object (JS_ARRAY or JS_OBJECT)
Implementor should setup iteration state in ti->prv
*/
JSPFN_ITERBEGIN iterBegin;
Expand All @@ -199,7 +199,7 @@ typedef struct __JSONObjectEncoder {
JSPFN_ITERNEXT iterNext;

/*
Ends the iteration of an iteratable object.
Ends the iteration of an iterable object.
Any iteration state stored in ti->prv can be freed here
*/
JSPFN_ITEREND iterEnd;
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/testing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ cpdef assert_almost_equal(a, b,
return True

if isna(a) and not isna(b) or not isna(a) and isna(b):
# boolean value of pd.NA is ambigous
# boolean value of pd.NA is ambiguous
raise AssertionError(f"{a} != {b}")

if a == b:
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ cdef class _Timedelta(timedelta):

def total_seconds(self) -> float:
"""Total seconds in the duration."""
# We need to override bc we overrided days/seconds/microseconds
# We need to override bc we overrode days/seconds/microseconds
# TODO: add nanos/1e9?
return self.days * 24 * 3600 + self.seconds + self.microseconds / 1_000_000

Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,7 @@ default 'raise'
Monday == 1 ... Sunday == 7.
"""
# same as super().isoweekday(), but that breaks because of how
# we have overriden year, see note in create_timestamp_from_ts
# we have overridden year, see note in create_timestamp_from_ts
return self.weekday() + 1

def weekday(self):
Expand All @@ -2354,7 +2354,7 @@ default 'raise'
Monday == 0 ... Sunday == 6.
"""
# same as super().weekday(), but that breaks because of how
# we have overriden year, see note in create_timestamp_from_ts
# we have overridden year, see note in create_timestamp_from_ts
return ccalendar.dayofweek(self.year, self.month, self.day)


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ ignore = [
"PLR2004",
# Outer loop variable overwritten by inner assignment
"PLW2901",
# Consider `elif` instead of `else` then `if` to remove indendation level
# Consider `elif` instead of `else` then `if` to remove indentation level
"PLR5501",
]

Expand Down Expand Up @@ -614,5 +614,5 @@ exclude_lines = [
directory = "coverage_html_report"

[tool.codespell]
ignore-words-list = "blocs, coo, hist, nd, sav, ser, recuse"
ignore-words-list = "blocs, coo, hist, nd, sav, ser, recuse, nin, timere"
ignore-regex = 'https://([\w/\.])+'