Skip to content

Commit 3dc58d6

Browse files
committed
add ci-check for python2 new style classes
1 parent bfd3d92 commit 3dc58d6

39 files changed

+272
-268
lines changed

asv_bench/benchmarks/algorithms.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
pass
1414

1515

16-
class Factorize(object):
16+
class Factorize:
1717

1818
params = [[True, False], ['int', 'uint', 'float', 'string']]
1919
param_names = ['sort', 'dtype']
@@ -30,7 +30,7 @@ def time_factorize(self, sort, dtype):
3030
self.idx.factorize(sort=sort)
3131

3232

33-
class FactorizeUnique(object):
33+
class FactorizeUnique:
3434

3535
params = [[True, False], ['int', 'uint', 'float', 'string']]
3636
param_names = ['sort', 'dtype']
@@ -48,7 +48,7 @@ def time_factorize(self, sort, dtype):
4848
self.idx.factorize(sort=sort)
4949

5050

51-
class Duplicated(object):
51+
class Duplicated:
5252

5353
params = [['first', 'last', False], ['int', 'uint', 'float', 'string']]
5454
param_names = ['keep', 'dtype']
@@ -67,7 +67,7 @@ def time_duplicated(self, keep, dtype):
6767
self.idx.duplicated(keep=keep)
6868

6969

70-
class DuplicatedUniqueIndex(object):
70+
class DuplicatedUniqueIndex:
7171

7272
params = ['int', 'uint', 'float', 'string']
7373
param_names = ['dtype']
@@ -86,7 +86,7 @@ def time_duplicated_unique(self, dtype):
8686
self.idx.duplicated()
8787

8888

89-
class Hashing(object):
89+
class Hashing:
9090

9191
def setup_cache(self):
9292
N = 10**5
@@ -124,7 +124,7 @@ def time_series_dates(self, df):
124124
hashing.hash_pandas_object(df['dates'])
125125

126126

127-
class Quantile(object):
127+
class Quantile:
128128
params = [[0, 0.5, 1],
129129
['linear', 'nearest', 'lower', 'higher', 'midpoint'],
130130
['float', 'int', 'uint']]

asv_bench/benchmarks/attrs_caching.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pandas.util.decorators import cache_readonly
77

88

9-
class DataFrameAttributes(object):
9+
class DataFrameAttributes:
1010

1111
def setup(self):
1212
self.df = DataFrame(np.random.randn(10, 6))
@@ -19,7 +19,7 @@ def time_set_index(self):
1919
self.df.index = self.cur_index
2020

2121

22-
class CacheReadonly(object):
22+
class CacheReadonly:
2323

2424
def setup(self):
2525

asv_bench/benchmarks/binary_ops.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pandas.computation.expressions as expr
88

99

10-
class Ops(object):
10+
class Ops:
1111

1212
params = [[True, False], ['default', 1]]
1313
param_names = ['use_numexpr', 'threads']
@@ -38,7 +38,7 @@ def teardown(self, use_numexpr, threads):
3838
expr.set_numexpr_threads()
3939

4040

41-
class Ops2(object):
41+
class Ops2:
4242

4343
def setup(self):
4444
N = 10**3
@@ -88,7 +88,7 @@ def time_frame_series_dot(self):
8888
self.df.dot(self.s)
8989

9090

91-
class Timeseries(object):
91+
class Timeseries:
9292

9393
params = [None, 'US/Eastern']
9494
param_names = ['tz']
@@ -114,7 +114,7 @@ def time_timestamp_ops_diff_with_shift(self, tz):
114114
self.s - self.s.shift()
115115

116116

117-
class AddOverflowScalar(object):
117+
class AddOverflowScalar:
118118

119119
params = [1, -1, 0]
120120
param_names = ['scalar']
@@ -127,7 +127,7 @@ def time_add_overflow_scalar(self, scalar):
127127
checked_add_with_arr(self.arr, scalar)
128128

129129

130-
class AddOverflowArray(object):
130+
class AddOverflowArray:
131131

132132
def setup(self):
133133
N = 10**6

asv_bench/benchmarks/categoricals.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
pass
1313

1414

15-
class Concat(object):
15+
class Concat:
1616

1717
def setup(self):
1818
N = 10**5
@@ -28,7 +28,7 @@ def time_union(self):
2828
union_categoricals([self.a, self.b])
2929

3030

31-
class Constructor(object):
31+
class Constructor:
3232

3333
def setup(self):
3434
N = 10**5
@@ -77,7 +77,7 @@ def time_existing_series(self):
7777
pd.Categorical(self.series)
7878

7979

80-
class ValueCounts(object):
80+
class ValueCounts:
8181

8282
params = [True, False]
8383
param_names = ['dropna']
@@ -92,7 +92,7 @@ def time_value_counts(self, dropna):
9292
self.ts.value_counts(dropna=dropna)
9393

9494

95-
class Repr(object):
95+
class Repr:
9696

9797
def setup(self):
9898
self.sel = pd.Series(['s1234']).astype('category')
@@ -101,7 +101,7 @@ def time_rendering(self):
101101
str(self.sel)
102102

103103

104-
class SetCategories(object):
104+
class SetCategories:
105105

106106
def setup(self):
107107
n = 5 * 10**5
@@ -113,7 +113,7 @@ def time_set_categories(self):
113113
self.ts.cat.set_categories(self.ts.cat.categories[::2])
114114

115115

116-
class RemoveCategories(object):
116+
class RemoveCategories:
117117

118118
def setup(self):
119119
n = 5 * 10**5
@@ -125,7 +125,7 @@ def time_remove_categories(self):
125125
self.ts.cat.remove_categories(self.ts.cat.categories[::2])
126126

127127

128-
class Rank(object):
128+
class Rank:
129129

130130
def setup(self):
131131
N = 10**5
@@ -162,7 +162,7 @@ def time_rank_int_cat_ordered(self):
162162
self.s_int_cat_ordered.rank()
163163

164164

165-
class Isin(object):
165+
class Isin:
166166

167167
params = ['object', 'int64']
168168
param_names = ['dtype']
@@ -181,7 +181,7 @@ def time_isin_categorical(self, dtype):
181181
self.series.isin(self.sample)
182182

183183

184-
class IsMonotonic(object):
184+
class IsMonotonic:
185185

186186
def setup(self):
187187
N = 1000
@@ -201,7 +201,7 @@ def time_categorical_series_is_monotonic_decreasing(self):
201201
self.s.is_monotonic_decreasing
202202

203203

204-
class Contains(object):
204+
class Contains:
205205

206206
def setup(self):
207207
N = 10**5
@@ -216,7 +216,7 @@ def time_categorical_contains(self):
216216
self.key in self.c
217217

218218

219-
class CategoricalSlicing(object):
219+
class CategoricalSlicing:
220220

221221
params = ['monotonic_incr', 'monotonic_decr', 'non_monotonic']
222222
param_names = ['index']
@@ -257,7 +257,7 @@ def time_getitem_bool_array(self, index):
257257
self.data[self.data == self.cat_scalar]
258258

259259

260-
class Indexing(object):
260+
class Indexing:
261261

262262
def setup(self):
263263
N = 10**5

asv_bench/benchmarks/ctors.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def list_of_lists_with_none(arr):
3939
return [[i, -i] for i in arr][:-1] + [None]
4040

4141

42-
class SeriesConstructors(object):
42+
class SeriesConstructors:
4343

4444
param_names = ["data_fmt", "with_index", "dtype"]
4545
params = [[no_change,
@@ -68,7 +68,7 @@ def time_series_constructor(self, data_fmt, with_index, dtype):
6868
Series(self.data, index=self.index)
6969

7070

71-
class SeriesDtypesConstructors(object):
71+
class SeriesDtypesConstructors:
7272

7373
def setup(self):
7474
N = 10**4
@@ -90,7 +90,7 @@ def time_dtindex_from_index_with_series(self):
9090
Index(self.s)
9191

9292

93-
class MultiIndexConstructor(object):
93+
class MultiIndexConstructor:
9494

9595
def setup(self):
9696
N = 10**4

asv_bench/benchmarks/dtypes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
_dtypes = _numpy_dtypes + extension_dtypes
1313

1414

15-
class Dtypes(object):
15+
class Dtypes:
1616
params = (_dtypes +
1717
list(map(lambda dt: dt.name, _dtypes)))
1818
param_names = ['dtype']
@@ -21,7 +21,7 @@ def time_pandas_dtype(self, dtype):
2121
pandas_dtype(dtype)
2222

2323

24-
class DtypesInvalid(object):
24+
class DtypesInvalid:
2525
param_names = ['dtype']
2626
params = ['scalar-string', 'scalar-int', 'list-string', 'array-string']
2727
data_dict = {'scalar-string': 'foo',

asv_bench/benchmarks/eval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pandas.computation.expressions as expr
77

88

9-
class Eval(object):
9+
class Eval:
1010

1111
params = [['numexpr', 'python'], [1, 'all']]
1212
param_names = ['engine', 'threads']
@@ -37,7 +37,7 @@ def teardown(self, engine, threads):
3737
expr.set_numexpr_threads()
3838

3939

40-
class Query(object):
40+
class Query:
4141

4242
def setup(self):
4343
N = 10**6

asv_bench/benchmarks/frame_ctor.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pandas.core.datetools import * # noqa
99

1010

11-
class FromDicts(object):
11+
class FromDicts:
1212

1313
def setup(self):
1414
N, K = 5000, 50
@@ -41,7 +41,7 @@ def time_nested_dict_int64(self):
4141
DataFrame(self.data2)
4242

4343

44-
class FromSeries(object):
44+
class FromSeries:
4545

4646
def setup(self):
4747
mi = MultiIndex.from_product([range(100), range(100)])
@@ -51,7 +51,7 @@ def time_mi_series(self):
5151
DataFrame(self.s)
5252

5353

54-
class FromDictwithTimestamp(object):
54+
class FromDictwithTimestamp:
5555

5656
params = [Nano(1), Hour(1)]
5757
param_names = ['offset']
@@ -67,7 +67,7 @@ def time_dict_with_timestamp_offsets(self, offset):
6767
DataFrame(self.d)
6868

6969

70-
class FromRecords(object):
70+
class FromRecords:
7171

7272
params = [None, 1000]
7373
param_names = ['nrows']
@@ -81,7 +81,7 @@ def time_frame_from_records_generator(self, nrows):
8181
self.df = DataFrame.from_records(self.gen, nrows=nrows)
8282

8383

84-
class FromNDArray(object):
84+
class FromNDArray:
8585

8686
def setup(self):
8787
N = 100000
@@ -91,7 +91,7 @@ def time_frame_from_ndarray(self):
9191
self.df = DataFrame(self.data)
9292

9393

94-
class FromLists(object):
94+
class FromLists:
9595

9696
goal_time = 0.2
9797

0 commit comments

Comments
 (0)