Skip to content

CLN: remove unneeded inheritance from base object #26128

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 2 commits into from
Apr 18, 2019
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions asv_bench/benchmarks/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pass


class Factorize(object):
class Factorize:

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


class FactorizeUnique(object):
class FactorizeUnique:

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


class Duplicated(object):
class Duplicated:

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


class DuplicatedUniqueIndex(object):
class DuplicatedUniqueIndex:

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


class Hashing(object):
class Hashing:

def setup_cache(self):
N = 10**5
Expand Down Expand Up @@ -124,7 +124,7 @@ def time_series_dates(self, df):
hashing.hash_pandas_object(df['dates'])


class Quantile(object):
class Quantile:
params = [[0, 0.5, 1],
['linear', 'nearest', 'lower', 'higher', 'midpoint'],
['float', 'int', 'uint']]
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/attrs_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pandas.util.decorators import cache_readonly


class DataFrameAttributes(object):
class DataFrameAttributes:

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


class CacheReadonly(object):
class CacheReadonly:

def setup(self):

Expand Down
10 changes: 5 additions & 5 deletions asv_bench/benchmarks/binary_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pandas.computation.expressions as expr


class Ops(object):
class Ops:

params = [[True, False], ['default', 1]]
param_names = ['use_numexpr', 'threads']
Expand Down Expand Up @@ -38,7 +38,7 @@ def teardown(self, use_numexpr, threads):
expr.set_numexpr_threads()


class Ops2(object):
class Ops2:

def setup(self):
N = 10**3
Expand Down Expand Up @@ -88,7 +88,7 @@ def time_frame_series_dot(self):
self.df.dot(self.s)


class Timeseries(object):
class Timeseries:

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


class AddOverflowScalar(object):
class AddOverflowScalar:

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


class AddOverflowArray(object):
class AddOverflowArray:

def setup(self):
N = 10**6
Expand Down
24 changes: 12 additions & 12 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
pass


class Concat(object):
class Concat:

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


class Constructor(object):
class Constructor:

def setup(self):
N = 10**5
Expand Down Expand Up @@ -77,7 +77,7 @@ def time_existing_series(self):
pd.Categorical(self.series)


class ValueCounts(object):
class ValueCounts:

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


class Repr(object):
class Repr:

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


class SetCategories(object):
class SetCategories:

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


class RemoveCategories(object):
class RemoveCategories:

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


class Rank(object):
class Rank:

def setup(self):
N = 10**5
Expand Down Expand Up @@ -162,7 +162,7 @@ def time_rank_int_cat_ordered(self):
self.s_int_cat_ordered.rank()


class Isin(object):
class Isin:

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


class IsMonotonic(object):
class IsMonotonic:

def setup(self):
N = 1000
Expand All @@ -201,7 +201,7 @@ def time_categorical_series_is_monotonic_decreasing(self):
self.s.is_monotonic_decreasing


class Contains(object):
class Contains:

def setup(self):
N = 10**5
Expand All @@ -216,7 +216,7 @@ def time_categorical_contains(self):
self.key in self.c


class CategoricalSlicing(object):
class CategoricalSlicing:

params = ['monotonic_incr', 'monotonic_decr', 'non_monotonic']
param_names = ['index']
Expand Down Expand Up @@ -257,7 +257,7 @@ def time_getitem_bool_array(self, index):
self.data[self.data == self.cat_scalar]


class Indexing(object):
class Indexing:

def setup(self):
N = 10**5
Expand Down
6 changes: 3 additions & 3 deletions asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def list_of_lists_with_none(arr):
return [[i, -i] for i in arr][:-1] + [None]


class SeriesConstructors(object):
class SeriesConstructors:

param_names = ["data_fmt", "with_index", "dtype"]
params = [[no_change,
Expand Down Expand Up @@ -68,7 +68,7 @@ def time_series_constructor(self, data_fmt, with_index, dtype):
Series(self.data, index=self.index)


class SeriesDtypesConstructors(object):
class SeriesDtypesConstructors:

def setup(self):
N = 10**4
Expand All @@ -90,7 +90,7 @@ def time_dtindex_from_index_with_series(self):
Index(self.s)


class MultiIndexConstructor(object):
class MultiIndexConstructor:

def setup(self):
N = 10**4
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_dtypes = _numpy_dtypes + extension_dtypes


class Dtypes(object):
class Dtypes:
params = (_dtypes +
list(map(lambda dt: dt.name, _dtypes)))
param_names = ['dtype']
Expand All @@ -21,7 +21,7 @@ def time_pandas_dtype(self, dtype):
pandas_dtype(dtype)


class DtypesInvalid(object):
class DtypesInvalid:
param_names = ['dtype']
params = ['scalar-string', 'scalar-int', 'list-string', 'array-string']
data_dict = {'scalar-string': 'foo',
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pandas.computation.expressions as expr


class Eval(object):
class Eval:

params = [['numexpr', 'python'], [1, 'all']]
param_names = ['engine', 'threads']
Expand Down Expand Up @@ -37,7 +37,7 @@ def teardown(self, engine, threads):
expr.set_numexpr_threads()


class Query(object):
class Query:

def setup(self):
N = 10**6
Expand Down
12 changes: 6 additions & 6 deletions asv_bench/benchmarks/frame_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pandas.core.datetools import * # noqa


class FromDicts(object):
class FromDicts:

def setup(self):
N, K = 5000, 50
Expand Down Expand Up @@ -41,7 +41,7 @@ def time_nested_dict_int64(self):
DataFrame(self.data2)


class FromSeries(object):
class FromSeries:

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


class FromDictwithTimestamp(object):
class FromDictwithTimestamp:

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


class FromRecords(object):
class FromRecords:

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


class FromNDArray(object):
class FromNDArray:

def setup(self):
N = 100000
Expand All @@ -91,7 +91,7 @@ def time_frame_from_ndarray(self):
self.df = DataFrame(self.data)


class FromLists(object):
class FromLists:

goal_time = 0.2

Expand Down
Loading