Skip to content

Commit 5118a6e

Browse files
committed
remove from exclusions + cleanup
1 parent 30589f7 commit 5118a6e

File tree

21 files changed

+82
-77
lines changed

21 files changed

+82
-77
lines changed

asv_bench/benchmarks/attrs_caching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup(self):
1515
self.cur_index = self.df.index
1616

1717
def time_get_index(self):
18-
self.foo = self.df.index
18+
self.foo_index = self.df.index
1919

2020
def time_set_index(self):
2121
self.df.index = self.cur_index

pandas/io/formats/style.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,7 +3209,7 @@ def set_properties(self, subset: Subset | None = None, **kwargs) -> Styler:
32093209
return self.applymap(lambda x: values, subset=subset)
32103210

32113211
@Substitution(subset=subset)
3212-
def bar(
3212+
def barchart(
32133213
self,
32143214
subset: Subset | None = None,
32153215
axis: Axis | None = 0,
@@ -4216,7 +4216,7 @@ def css_calc(x, left: float, right: float, align: str, color: str | list | tuple
42164216
rgbas = None
42174217
if cmap is not None:
42184218
# use the matplotlib colormap input
4219-
with _mpl(Styler.bar) as (plt, mpl):
4219+
with _mpl(Styler.barchart) as (plt, mpl):
42204220
from pandas.plotting._matplotlib.compat import mpl_ge_3_6_0
42214221

42224222
cmap = (

pandas/plotting/_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def line(self, x=None, y=None, **kwargs) -> PlotAccessor:
11311131
)
11321132
@Substitution(kind="bar")
11331133
@Appender(_bar_or_line_doc)
1134-
def bar(self, x=None, y=None, **kwargs) -> PlotAccessor:
1134+
def barplot(self, x=None, y=None, **kwargs) -> PlotAccessor:
11351135
"""
11361136
Vertical bar plot.
11371137

pandas/tests/apply/test_frame_apply.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,10 +1509,10 @@ def test_aggregation_func_column_order():
15091509
columns=("item", "att1", "att2", "att3"),
15101510
)
15111511

1512-
def foo(s):
1512+
def sum_div2(s):
15131513
return s.sum() / 2
15141514

1515-
aggs = ["sum", foo, "count", "min"]
1515+
aggs = ["sum", sum_div2, "count", "min"]
15161516
with tm.assert_produces_warning(
15171517
FutureWarning, match=r"\['item'\] did not aggregate successfully"
15181518
):
@@ -1524,7 +1524,7 @@ def foo(s):
15241524
"att2": [18.0, 9.0, 6.0, 0.0],
15251525
"att3": [17.0, 8.5, 6.0, 0.0],
15261526
},
1527-
index=["sum", "foo", "count", "min"],
1527+
index=["sum", "sum_div2", "count", "min"],
15281528
)
15291529
tm.assert_frame_equal(result, expected)
15301530

@@ -1545,13 +1545,13 @@ def test_nuisance_depr_passes_through_warnings():
15451545
# sure if some other warnings were raised, they get passed through to
15461546
# the user.
15471547

1548-
def foo(x):
1548+
def expected_warning(x):
15491549
warnings.warn("Hello, World!")
15501550
return x.sum()
15511551

15521552
df = DataFrame({"a": [1, 2, 3]})
15531553
with tm.assert_produces_warning(UserWarning, match="Hello, World!"):
1554-
df.agg([foo])
1554+
df.agg([expected_warning])
15551555

15561556

15571557
def test_apply_type():

pandas/tests/base/test_constructors.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ class Delegator:
4646
_properties = ["foo"]
4747
_methods = ["bar"]
4848

49-
def _set_foo(self, value):
50-
self.foo = value
49+
def _set_value(self, value):
50+
self.value = value
5151

52-
def _get_foo(self):
53-
return self.foo
52+
def _get_value(self):
53+
return self.value
5454

55-
foo = property(_get_foo, _set_foo, doc="foo property")
55+
value = property(_get_value, _set_value, doc="foo property")
5656

57-
def bar(self, *args, **kwargs):
57+
def test_method(self, *args, **kwargs):
5858
"""a test bar method"""
5959
pass
6060

@@ -80,15 +80,15 @@ def test_invalid_delegation(self):
8080

8181
msg = "You cannot access the property foo"
8282
with pytest.raises(TypeError, match=msg):
83-
delegate.foo
83+
delegate.inaccesible
8484

8585
msg = "The property foo cannot be set"
8686
with pytest.raises(TypeError, match=msg):
87-
delegate.foo = 5
87+
delegate.inaccesible = 5
8888

8989
msg = "You cannot access the property foo"
9090
with pytest.raises(TypeError, match=msg):
91-
delegate.foo()
91+
delegate.inaccesible()
9292

9393
@pytest.mark.skipif(PYPY, reason="not relevant for PyPy")
9494
def test_memory_usage(self):

pandas/tests/dtypes/test_inference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,16 @@ def test_is_list_like_disallow_sets(maybe_list_like):
203203
def test_is_list_like_recursion():
204204
# GH 33721
205205
# interpreter would crash with SIGABRT
206-
def foo():
206+
def list_like():
207207
inference.is_list_like([])
208-
foo()
208+
list_like()
209209

210210
rec_limit = sys.getrecursionlimit()
211211
try:
212212
# Limit to avoid stack overflow on Windows CI
213213
sys.setrecursionlimit(100)
214214
with tm.external_error_raised(RecursionError):
215-
foo()
215+
list_like()
216216
finally:
217217
sys.setrecursionlimit(rec_limit)
218218

pandas/tests/frame/test_subclass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ def test_subclass_attr_err_propagation(self):
138138
# GH 11808
139139
class A(DataFrame):
140140
@property
141-
def bar(self):
141+
def nonexistence(self):
142142
return self.i_dont_exist
143143

144144
with pytest.raises(AttributeError, match=".*i_dont_exist.*"):
145-
A().bar
145+
A().nonexistence
146146

147147
def test_subclass_align(self):
148148
# GH 12983

pandas/tests/groupby/aggregate/test_aggregate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ def test_aggregate_item_by_item(df):
283283

284284
aggfun_0 = lambda ser: ser.size
285285
result = grouped.agg(aggfun_0)
286-
foo = (df.A == "foo").sum()
287-
bar = (df.A == "bar").sum()
286+
foosum = (df.A == "foo").sum()
287+
barsum = (df.A == "bar").sum()
288288
K = len(result.columns)
289289

290290
# GH5782
291-
exp = Series(np.array([foo] * K), index=list("BCD"), name="foo")
291+
exp = Series(np.array([foosum] * K), index=list("BCD"), name="foo")
292292
tm.assert_series_equal(result.xs("foo"), exp)
293293

294-
exp = Series(np.array([bar] * K), index=list("BCD"), name="bar")
294+
exp = Series(np.array([barsum] * K), index=list("BCD"), name="bar")
295295
tm.assert_almost_equal(result.xs("bar"), exp)
296296

297297
def aggfun_1(ser):
@@ -420,10 +420,10 @@ def test_more_flexible_frame_multi_function(df):
420420
expected = grouped.aggregate({"C": np.mean, "D": [np.mean, np.std]})
421421
tm.assert_frame_equal(result, expected)
422422

423-
def foo(x):
423+
def numpymean(x):
424424
return np.mean(x)
425425

426-
def bar(x):
426+
def numpystd(x):
427427
return np.std(x, ddof=1)
428428

429429
# this uses column selection & renaming
@@ -433,7 +433,7 @@ def bar(x):
433433
grouped.aggregate(d)
434434

435435
# But without renaming, these functions are OK
436-
d = {"C": [np.mean], "D": [foo, bar]}
436+
d = {"C": [np.mean], "D": [numpymean, numpystd]}
437437
grouped.aggregate(d)
438438

439439

pandas/tests/groupby/test_groupby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ def freduce(group):
15791579
assert group.name is not None
15801580
return group.sum()
15811581

1582-
def foo(x):
1582+
def freducex(x):
15831583
return freduce(x)
15841584

15851585
grouped = df.groupby(grouper, group_keys=False)
@@ -1592,7 +1592,7 @@ def foo(x):
15921592

15931593
grouped["C"].apply(f)
15941594
grouped["C"].aggregate(freduce)
1595-
grouped["C"].aggregate([freduce, foo])
1595+
grouped["C"].aggregate([freduce, freducex])
15961596
grouped["C"].transform(f)
15971597

15981598

pandas/tests/indexes/multi/test_integrity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ def test_level_setting_resets_attributes():
233233

234234
def test_rangeindex_fallback_coercion_bug():
235235
# GH 12893
236-
foo = pd.DataFrame(np.arange(100).reshape((10, 10)))
237-
bar = pd.DataFrame(np.arange(100).reshape((10, 10)))
238-
df = pd.concat({"foo": foo.stack(), "bar": bar.stack()}, axis=1)
236+
df1 = pd.DataFrame(np.arange(100).reshape((10, 10)))
237+
df2 = pd.DataFrame(np.arange(100).reshape((10, 10)))
238+
df = pd.concat({"df1": df1.stack(), "df2": df2.stack()}, axis=1)
239239
df.index.names = ["fizz", "buzz"]
240240

241241
str(df)
242242
expected = pd.DataFrame(
243-
{"bar": np.arange(100), "foo": np.arange(100)},
243+
{"df2": np.arange(100), "df1": np.arange(100)},
244244
index=MultiIndex.from_product([range(10), range(10)], names=["fizz", "buzz"]),
245245
)
246246
tm.assert_frame_equal(df, expected, check_like=True)

0 commit comments

Comments
 (0)