Skip to content

Commit 082d437

Browse files
authored
STYLE: Extending codespell to pandas/tests/ part3 38802 (#40372)
* STYLE: Extending codespell to pandas/tests part 3 * DOC: small change in test_internals.py * TST: small changes in test_to_xml.py
1 parent bf31347 commit 082d437

24 files changed

+49
-50
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ repos:
1616
- id: codespell
1717
types_or: [python, rst, markdown]
1818
files: ^(pandas|doc)/
19-
exclude: ^pandas/tests/
2019
- repo: https://github.com/pre-commit/pre-commit-hooks
2120
rev: v3.4.0
2221
hooks:

pandas/tests/indexing/multiindex/test_loc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def test_loc_multiindex_incomplete(self):
264264
tm.assert_series_equal(result, expected)
265265

266266
# GH 7400
267-
# multiindexer gettitem with list of indexers skips wrong element
267+
# multiindexer getitem with list of indexers skips wrong element
268268
s = Series(
269269
np.arange(15, dtype="int64"),
270270
MultiIndex.from_product([range(5), ["a", "b", "c"]]),
@@ -385,7 +385,7 @@ def test_multiindex_setitem_columns_enlarging(self, indexer, exp_value):
385385
[
386386
([], []), # empty ok
387387
(["A"], slice(3)),
388-
(["A", "D"], []), # "D" isnt present -> raise
388+
(["A", "D"], []), # "D" isn't present -> raise
389389
(["D", "E"], []), # no values found -> raise
390390
(["D"], []), # same, with single item list: GH 27148
391391
(pd.IndexSlice[:, ["foo"]], slice(2, None, 3)),
@@ -531,7 +531,7 @@ def test_loc_period_string_indexing():
531531
# GH 9892
532532
a = pd.period_range("2013Q1", "2013Q4", freq="Q")
533533
i = (1111, 2222, 3333)
534-
idx = MultiIndex.from_product((a, i), names=("Periode", "CVR"))
534+
idx = MultiIndex.from_product((a, i), names=("Period", "CVR"))
535535
df = DataFrame(
536536
index=idx,
537537
columns=(
@@ -552,7 +552,7 @@ def test_loc_period_string_indexing():
552552
dtype=object,
553553
name="OMS",
554554
index=MultiIndex.from_tuples(
555-
[(pd.Period("2013Q1"), 1111)], names=["Periode", "CVR"]
555+
[(pd.Period("2013Q1"), 1111)], names=["Period", "CVR"]
556556
),
557557
)
558558
tm.assert_series_equal(result, expected)

pandas/tests/indexing/test_loc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ def test_loc_setitem_str_to_small_float_conversion_type(self):
10721072
tm.assert_frame_equal(result, expected)
10731073

10741074
# assigning with loc/iloc attempts to set the values inplace, which
1075-
# in this case is succesful
1075+
# in this case is successful
10761076
result.loc[result.index, "A"] = [float(x) for x in col_data]
10771077
expected = DataFrame(col_data, columns=["A"], dtype=float).astype(object)
10781078
tm.assert_frame_equal(result, expected)

pandas/tests/internals/test_internals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,8 @@ def assert_slice_ok(mgr, axis, slobj):
829829
elif mgr.ndim == 1 and axis == 0:
830830
sliced = mgr.getitem_mgr(slobj)
831831
else:
832-
# BlockManager doesnt support non-slice, SingleBlockManager
833-
# doesnt support axis > 0
832+
# BlockManager doesn't support non-slice, SingleBlockManager
833+
# doesn't support axis > 0
834834
return
835835

836836
mat_slobj = (slice(None),) * axis + (slobj,)

pandas/tests/io/pytables/test_append.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def test_append_frame_column_oriented(setup_path):
281281

282282
# column oriented
283283
df = tm.makeTimeDataFrame()
284-
df.index = df.index._with_freq(None) # freq doesnt round-trip
284+
df.index = df.index._with_freq(None) # freq doesn't round-trip
285285

286286
_maybe_remove(store, "df1")
287287
store.append("df1", df.iloc[:, :2], axes=["columns"])
@@ -331,7 +331,7 @@ def test_append_with_different_block_ordering(setup_path):
331331
store.append("df", df)
332332

333333
# test a different ordering but with more fields (like invalid
334-
# combinate)
334+
# combinations)
335335
with ensure_clean_store(setup_path) as store:
336336

337337
df = DataFrame(np.random.randn(10, 2), columns=list("AB"), dtype="float64")

pandas/tests/io/pytables/test_round_trip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def test_timeseries_preepoch(setup_path):
350350
try:
351351
_check_roundtrip(ts, tm.assert_series_equal, path=setup_path)
352352
except OverflowError:
353-
pytest.skip("known failer on some windows platforms")
353+
pytest.skip("known failure on some windows platforms")
354354

355355

356356
@pytest.mark.parametrize(

pandas/tests/io/pytables/test_select.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,13 +663,13 @@ def test_frame_select_complex(setup_path):
663663

664664
def test_frame_select_complex2(setup_path):
665665

666-
with ensure_clean_path(["parms.hdf", "hist.hdf"]) as paths:
666+
with ensure_clean_path(["params.hdf", "hist.hdf"]) as paths:
667667

668668
pp, hh = paths
669669

670670
# use non-trivial selection criteria
671-
parms = DataFrame({"A": [1, 1, 2, 2, 3]})
672-
parms.to_hdf(pp, "df", mode="w", format="table", data_columns=["A"])
671+
params = DataFrame({"A": [1, 1, 2, 2, 3]})
672+
params.to_hdf(pp, "df", mode="w", format="table", data_columns=["A"])
673673

674674
selection = read_hdf(pp, "df", where="A=[2,3]")
675675
hist = DataFrame(

pandas/tests/io/pytables/test_timezones.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_append_with_timezones_as_index(setup_path, gettz):
137137
# GH#4098 example
138138

139139
dti = date_range("2000-1-1", periods=3, freq="H", tz=gettz("US/Eastern"))
140-
dti = dti._with_freq(None) # freq doesnt round-trip
140+
dti = dti._with_freq(None) # freq doesn't round-trip
141141

142142
df = DataFrame({"A": Series(range(3), index=dti)})
143143

@@ -217,7 +217,7 @@ def test_timezones_fixed_format_frame_non_empty(setup_path):
217217

218218
# index
219219
rng = date_range("1/1/2000", "1/30/2000", tz="US/Eastern")
220-
rng = rng._with_freq(None) # freq doesnt round-trip
220+
rng = rng._with_freq(None) # freq doesn't round-trip
221221
df = DataFrame(np.random.randn(len(rng), 4), index=rng)
222222
store["df"] = df
223223
result = store["df"]
@@ -334,7 +334,7 @@ def test_dst_transitions(setup_path):
334334
freq="H",
335335
ambiguous="infer",
336336
)
337-
times = times._with_freq(None) # freq doesnt round-trip
337+
times = times._with_freq(None) # freq doesn't round-trip
338338

339339
for i in [times, times + pd.Timedelta("10min")]:
340340
_maybe_remove(store, "df")

pandas/tests/io/xml/test_to_xml.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ def test_attrs_cols_prefix(datapath, parser):
411411

412412
def test_attrs_unknown_column(parser):
413413
with pytest.raises(KeyError, match=("no valid column")):
414-
geom_df.to_xml(attr_cols=["shape", "degreees", "sides"], parser=parser)
414+
geom_df.to_xml(attr_cols=["shape", "degree", "sides"], parser=parser)
415415

416416

417417
def test_attrs_wrong_type(parser):
418418
with pytest.raises(TypeError, match=("is not a valid type for attr_cols")):
419-
geom_df.to_xml(attr_cols='"shape", "degreees", "sides"', parser=parser)
419+
geom_df.to_xml(attr_cols='"shape", "degree", "sides"', parser=parser)
420420

421421

422422
# ELEM_COLS
@@ -453,12 +453,12 @@ def test_elems_cols_nan_output(datapath, parser):
453453

454454
def test_elems_unknown_column(parser):
455455
with pytest.raises(KeyError, match=("no valid column")):
456-
geom_df.to_xml(elem_cols=["shape", "degreees", "sides"], parser=parser)
456+
geom_df.to_xml(elem_cols=["shape", "degree", "sides"], parser=parser)
457457

458458

459459
def test_elems_wrong_type(parser):
460460
with pytest.raises(TypeError, match=("is not a valid type for elem_cols")):
461-
geom_df.to_xml(elem_cols='"shape", "degreees", "sides"', parser=parser)
461+
geom_df.to_xml(elem_cols='"shape", "degree", "sides"', parser=parser)
462462

463463

464464
def test_elems_and_attrs_cols(datapath, parser):

pandas/tests/libs/test_hashtable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_no_reallocation(self, table_type, dtype):
170170
n_buckets_start = preallocated_table.get_state()["n_buckets"]
171171
preallocated_table.map_locations(keys)
172172
n_buckets_end = preallocated_table.get_state()["n_buckets"]
173-
# orgininal number of buckets was enough:
173+
# original number of buckets was enough:
174174
assert n_buckets_start == n_buckets_end
175175
# check with clean table (not too much preallocated)
176176
clean_table = table_type()
@@ -219,7 +219,7 @@ def test_no_reallocation_StringHashTable():
219219
n_buckets_start = preallocated_table.get_state()["n_buckets"]
220220
preallocated_table.map_locations(keys)
221221
n_buckets_end = preallocated_table.get_state()["n_buckets"]
222-
# orgininal number of buckets was enough:
222+
# original number of buckets was enough:
223223
assert n_buckets_start == n_buckets_end
224224
# check with clean table (not too much preallocated)
225225
clean_table = ht.StringHashTable()

0 commit comments

Comments
 (0)