Skip to content

Commit 9b8641c

Browse files
MarcoGorelliluckyvs1
authored andcommitted
CI,STYLE: add spell check? (pandas-dev#38776)
* run codespell on pandas/core * fix underline
1 parent 09bf658 commit 9b8641c

File tree

20 files changed

+46
-37
lines changed

20 files changed

+46
-37
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
minimum_pre_commit_version: '2.9.2'
1+
minimum_pre_commit_version: 2.9.2
22
repos:
33
- repo: https://github.com/python/black
44
rev: 20.8b1
@@ -168,3 +168,9 @@ repos:
168168
exclude: ^LICENSES/|\.(html|csv|txt|svg|py)$
169169
- id: trailing-whitespace
170170
exclude: \.(html|svg)$
171+
- repo: https://github.com/codespell-project/codespell
172+
rev: v2.0.0
173+
hooks:
174+
- id: codespell
175+
types_or: [python, rst, markdown]
176+
files: ^pandas/core/

pandas/core/arrays/_mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def fillna(
275275
if method is not None:
276276
func = missing.get_fill_func(method)
277277
new_values = func(self._ndarray.copy(), limit=limit, mask=mask)
278-
# TODO: PandasArray didnt used to copy, need tests for this
278+
# TODO: PandasArray didn't used to copy, need tests for this
279279
new_values = self._from_backing_data(new_values)
280280
else:
281281
# fill with value

pandas/core/arrays/datetimelike.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def isin(self, values) -> np.ndarray:
741741
return np.zeros(self.shape, dtype=bool)
742742

743743
if not isinstance(values, type(self)):
744-
inferrable = [
744+
inferable = [
745745
"timedelta",
746746
"timedelta64",
747747
"datetime",
@@ -751,7 +751,7 @@ def isin(self, values) -> np.ndarray:
751751
]
752752
if values.dtype == object:
753753
inferred = lib.infer_dtype(values, skipna=False)
754-
if inferred not in inferrable:
754+
if inferred not in inferable:
755755
if inferred == "string":
756756
pass
757757

pandas/core/arrays/floating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class FloatingArray(NumericArray):
175175
.. warning::
176176
177177
FloatingArray is currently experimental, and its API or internal
178-
implementation may change without warning. Expecially the behaviour
178+
implementation may change without warning. Especially the behaviour
179179
regarding NaN (distinct from NA missing values) is subject to change.
180180
181181
We represent a FloatingArray with 2 numpy arrays:

pandas/core/arrays/sparse/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def _concat_same_type(
975975

976976
else:
977977
# when concatenating block indices, we don't claim that you'll
978-
# get an identical index as concating the values and then
978+
# get an identical index as concatenating the values and then
979979
# creating a new index. We don't want to spend the time trying
980980
# to merge blocks across arrays in `to_concat`, so the resulting
981981
# BlockIndex may have more blocks.

pandas/core/arrays/sparse/dtype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _get_common_dtype(self, dtypes: List[DtypeObj]) -> Optional[DtypeObj]:
371371
fill_value = fill_values[0]
372372

373373
# np.nan isn't a singleton, so we may end up with multiple
374-
# NaNs here, so we ignore tha all NA case too.
374+
# NaNs here, so we ignore the all NA case too.
375375
if not (len(set(fill_values)) == 1 or isna(fill_values).all()):
376376
warnings.warn(
377377
"Concatenating sparse arrays with multiple fill "

pandas/core/arrays/string_arrow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def __setitem__(self, key: Union[int, np.ndarray], value: Any) -> None:
467467
elif not isinstance(value, str):
468468
raise ValueError("Scalar must be NA or str")
469469

470-
# Slice data and insert inbetween
470+
# Slice data and insert in-between
471471
new_data = [
472472
*self._data[0:key].chunks,
473473
pa.array([value], type=pa.string()),
@@ -616,7 +616,7 @@ def value_counts(self, dropna: bool = True) -> Series:
616616

617617
# Index cannot hold ExtensionArrays yet
618618
index = Index(type(self)(vc.field(0)).astype(object))
619-
# No missings, so we can adhere to the interface and return a numpy array.
619+
# No missing values so we can adhere to the interface and return a numpy array.
620620
counts = np.array(vc.field(1))
621621

622622
if dropna and self._data.null_count > 0:

pandas/core/computation/parsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def create_valid_python_identifier(name: str) -> str:
3535

3636
# Create a dict with the special characters and their replacement string.
3737
# EXACT_TOKEN_TYPES contains these special characters
38-
# toke.tok_name contains a readable description of the replacement string.
38+
# token.tok_name contains a readable description of the replacement string.
3939
special_characters_replacements = {
4040
char: f"_{token.tok_name[tokval]}_"
4141
# The ignore here is because of a bug in mypy that is resolved in 0.740

pandas/core/generic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5560,7 +5560,7 @@ def _is_mixed_type(self) -> bool_t:
55605560
return False
55615561

55625562
if self._mgr.any_extension_types:
5563-
# Even if they have the same dtype, we cant consolidate them,
5563+
# Even if they have the same dtype, we can't consolidate them,
55645564
# so we pretend this is "mixed'"
55655565
return True
55665566

@@ -10647,7 +10647,7 @@ def _add_numeric_operations(cls):
1064710647
"""
1064810648
Add the operations to the cls; evaluate the doc strings again
1064910649
"""
10650-
axis_descr, name1, name2 = _doc_parms(cls)
10650+
axis_descr, name1, name2 = _doc_params(cls)
1065110651

1065210652
@doc(
1065310653
_bool_doc,
@@ -11207,8 +11207,8 @@ def last_valid_index(self):
1120711207
return self._find_valid_index("last")
1120811208

1120911209

11210-
def _doc_parms(cls):
11211-
"""Return a tuple of the doc parms."""
11210+
def _doc_params(cls):
11211+
"""Return a tuple of the doc params."""
1121211212
axis_descr = (
1121311213
f"{{{', '.join(f'{a} ({i})' for i, a in enumerate(cls._AXIS_ORDERS))}}}"
1121411214
)

pandas/core/groupby/ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def _ea_wrap_cython_operation(
495495
If we have an ExtensionArray, unwrap, call _cython_operation, and
496496
re-wrap if appropriate.
497497
"""
498-
# TODO: general case implementation overrideable by EAs.
498+
# TODO: general case implementation overridable by EAs.
499499
orig_values = values
500500

501501
if is_datetime64tz_dtype(values.dtype) or is_period_dtype(values.dtype):

0 commit comments

Comments
 (0)