Skip to content

Commit 296c251

Browse files
Jerod Estapadatapythonista
Jerod Estapa
authored andcommitted
STYLE: Fixed linting of benchmarks (pandas-dev#22947)
1 parent e5ed297 commit 296c251

34 files changed

+119
-57
lines changed

asv_bench/benchmarks/algorithms.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
except (ImportError, TypeError, ValueError):
1313
pass
1414

15-
from .pandas_vb_common import setup # noqa
16-
1715

1816
class Factorize(object):
1917

@@ -126,3 +124,6 @@ def time_series_timedeltas(self, df):
126124

127125
def time_series_dates(self, df):
128126
hashing.hash_pandas_object(df['dates'])
127+
128+
129+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/attrs_caching.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
except ImportError:
66
from pandas.util.decorators import cache_readonly
77

8-
from .pandas_vb_common import setup # noqa
9-
108

119
class DataFrameAttributes(object):
1210

@@ -38,3 +36,6 @@ def prop(self):
3836

3937
def time_cache_readonly(self):
4038
self.obj.prop
39+
40+
41+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/binary_ops.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
except ImportError:
77
import pandas.computation.expressions as expr
88

9-
from .pandas_vb_common import setup # noqa
10-
119

1210
class Ops(object):
1311

@@ -149,3 +147,6 @@ def time_add_overflow_b_mask_nan(self):
149147
def time_add_overflow_both_arg_nan(self):
150148
checked_add_with_arr(self.arr, self.arr_mixed, arr_mask=self.arr_nan_1,
151149
b_mask=self.arr_nan_2)
150+
151+
152+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/categoricals.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
except ImportError:
1212
pass
1313

14-
from .pandas_vb_common import setup # noqa
15-
1614

1715
class Concat(object):
1816

@@ -245,3 +243,6 @@ def time_getitem_list(self, index):
245243

246244
def time_getitem_bool_array(self, index):
247245
self.data[self.data == self.cat_scalar]
246+
247+
248+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/ctors.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import pandas.util.testing as tm
33
from pandas import Series, Index, DatetimeIndex, Timestamp, MultiIndex
44

5-
from .pandas_vb_common import setup # noqa
6-
75

86
class SeriesConstructors(object):
97

@@ -64,3 +62,6 @@ def setup(self):
6462

6563
def time_multiindex_from_iterables(self):
6664
MultiIndex.from_product(self.iterables)
65+
66+
67+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/eval.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
except ImportError:
66
import pandas.computation.expressions as expr
77

8-
from .pandas_vb_common import setup # noqa
9-
108

119
class Eval(object):
1210

@@ -65,3 +63,6 @@ def time_query_datetime_column(self):
6563

6664
def time_query_with_boolean_selection(self):
6765
self.df.query('(a >= @self.min_val) & (a <= @self.max_val)')
66+
67+
68+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/frame_ctor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# For compatibility with older versions
88
from pandas.core.datetools import * # noqa
99

10-
from .pandas_vb_common import setup # noqa
11-
1210

1311
class FromDicts(object):
1412

@@ -99,3 +97,6 @@ def setup(self):
9997

10098
def time_frame_from_ndarray(self):
10199
self.df = DataFrame(self.data)
100+
101+
102+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/frame_methods.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
77
isnull, NaT)
88

9-
from .pandas_vb_common import setup # noqa
10-
119

1210
class GetNumericData(object):
1311

@@ -537,3 +535,6 @@ def time_series_describe(self):
537535

538536
def time_dataframe_describe(self):
539537
self.df.describe()
538+
539+
540+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/gil.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def wrapper(fname):
2323
return fname
2424
return wrapper
2525

26-
from .pandas_vb_common import BaseIO, setup # noqa
26+
from .pandas_vb_common import BaseIO
2727

2828

2929
class ParallelGroupbyMethods(object):
@@ -273,3 +273,6 @@ def time_parallel(self, threads):
273273
def time_loop(self, threads):
274274
for i in range(threads):
275275
self.loop()
276+
277+
278+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/groupby.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
TimeGrouper, Categorical, Timestamp)
99
import pandas.util.testing as tm
1010

11-
from .pandas_vb_common import setup # noqa
12-
1311

1412
method_blacklist = {
1513
'object': {'median', 'prod', 'sem', 'cumsum', 'sum', 'cummin', 'mean',
@@ -579,3 +577,6 @@ def setup(self):
579577

580578
def time_first(self):
581579
self.df_nans.groupby('key').transform('first')
580+
581+
582+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/index_object.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from pandas import (Series, date_range, DatetimeIndex, Index, RangeIndex,
44
Float64Index)
55

6-
from .pandas_vb_common import setup # noqa
7-
86

97
class SetOperations(object):
108

@@ -192,3 +190,6 @@ def setup(self):
192190

193191
def time_get_loc(self):
194192
self.ind.get_loc(0)
193+
194+
195+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/indexing.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import numpy as np
44
import pandas.util.testing as tm
5-
from pandas import (Series, DataFrame, MultiIndex, Panel,
6-
Int64Index, Float64Index, IntervalIndex,
7-
CategoricalIndex, IndexSlice, concat, date_range)
8-
from .pandas_vb_common import setup # noqa
5+
from pandas import (Series, DataFrame, MultiIndex, Int64Index, Float64Index,
6+
IntervalIndex, CategoricalIndex,
7+
IndexSlice, concat, date_range)
8+
from .pandas_vb_common import Panel
99

1010

1111
class NumericSeriesIndexing(object):
@@ -367,3 +367,6 @@ def time_assign_with_setitem(self):
367367
np.random.seed(1234)
368368
for i in range(100):
369369
self.df[i] = np.random.randn(self.N)
370+
371+
372+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/inference.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pandas.util.testing as tm
33
from pandas import DataFrame, Series, to_numeric
44

5-
from .pandas_vb_common import numeric_dtypes, lib, setup # noqa
5+
from .pandas_vb_common import numeric_dtypes, lib
66

77

88
class NumericInferOps(object):
@@ -111,3 +111,6 @@ def setup_cache(self):
111111

112112
def time_convert(self, data):
113113
lib.maybe_convert_numeric(data, set(), coerce_numeric=False)
114+
115+
116+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/csv.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pandas import DataFrame, Categorical, date_range, read_csv
77
from pandas.compat import cStringIO as StringIO
88

9-
from ..pandas_vb_common import setup, BaseIO # noqa
9+
from ..pandas_vb_common import BaseIO
1010

1111

1212
class ToCSV(BaseIO):
@@ -225,3 +225,6 @@ def time_baseline(self):
225225
read_csv(self.data(self.StringIO_input), sep=',', header=None,
226226
parse_dates=[1],
227227
names=list(string.digits[:9]))
228+
229+
230+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/excel.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pandas.compat import BytesIO
44
import pandas.util.testing as tm
55

6-
from ..pandas_vb_common import BaseIO, setup # noqa
6+
from ..pandas_vb_common import BaseIO
77

88

99
class Excel(object):
@@ -34,3 +34,6 @@ def time_write_excel(self, engine):
3434
writer_write = ExcelWriter(bio_write, engine=engine)
3535
self.df.to_excel(writer_write, sheet_name='Sheet1')
3636
writer_write.save()
37+
38+
39+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/hdf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pandas import DataFrame, Panel, date_range, HDFStore, read_hdf
55
import pandas.util.testing as tm
66

7-
from ..pandas_vb_common import BaseIO, setup # noqa
7+
from ..pandas_vb_common import BaseIO
88

99

1010
class HDFStoreDataFrame(BaseIO):
@@ -149,3 +149,6 @@ def time_read_hdf(self, format):
149149

150150
def time_write_hdf(self, format):
151151
self.df.to_hdf(self.fname, 'df', format=format)
152+
153+
154+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/json.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pandas.util.testing as tm
33
from pandas import DataFrame, date_range, timedelta_range, concat, read_json
44

5-
from ..pandas_vb_common import setup, BaseIO # noqa
5+
from ..pandas_vb_common import BaseIO
66

77

88
class ReadJSON(BaseIO):
@@ -125,3 +125,6 @@ def time_float_int_lines(self, orient):
125125

126126
def time_float_int_str_lines(self, orient):
127127
self.df_int_float_str.to_json(self.fname, orient='records', lines=True)
128+
129+
130+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/msgpack.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pandas import DataFrame, date_range, read_msgpack
33
import pandas.util.testing as tm
44

5-
from ..pandas_vb_common import BaseIO, setup # noqa
5+
from ..pandas_vb_common import BaseIO
66

77

88
class MSGPack(BaseIO):
@@ -24,3 +24,6 @@ def time_read_msgpack(self):
2424

2525
def time_write_msgpack(self):
2626
self.df.to_msgpack(self.fname)
27+
28+
29+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/pickle.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pandas import DataFrame, date_range, read_pickle
33
import pandas.util.testing as tm
44

5-
from ..pandas_vb_common import BaseIO, setup # noqa
5+
from ..pandas_vb_common import BaseIO
66

77

88
class Pickle(BaseIO):
@@ -24,3 +24,6 @@ def time_read_pickle(self):
2424

2525
def time_write_pickle(self):
2626
self.df.to_pickle(self.fname)
27+
28+
29+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/sql.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from pandas import DataFrame, date_range, read_sql_query, read_sql_table
66
from sqlalchemy import create_engine
77

8-
from ..pandas_vb_common import setup # noqa
9-
108

119
class SQL(object):
1210

@@ -130,3 +128,6 @@ def setup(self, dtype):
130128

131129
def time_read_sql_table_column(self, dtype):
132130
read_sql_table(self.table_name, self.con, columns=[dtype])
131+
132+
133+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/io/stata.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pandas import DataFrame, date_range, read_stata
33
import pandas.util.testing as tm
44

5-
from ..pandas_vb_common import BaseIO, setup # noqa
5+
from ..pandas_vb_common import BaseIO
66

77

88
class Stata(BaseIO):
@@ -35,3 +35,6 @@ def time_read_stata(self, convert_dates):
3535

3636
def time_write_stata(self, convert_dates):
3737
self.df.to_stata(self.fname, self.convert_dates)
38+
39+
40+
from ..pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/join_merge.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
except ImportError:
1212
from pandas import ordered_merge as merge_ordered
1313

14-
from .pandas_vb_common import setup # noqa
14+
from .pandas_vb_common import Panel
1515

1616

1717
class Append(object):
@@ -361,3 +361,6 @@ def time_series_align_int64_index(self):
361361

362362
def time_series_align_left_monotonic(self):
363363
self.ts1.align(self.ts2, join='left')
364+
365+
366+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/multiindex_object.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import pandas.util.testing as tm
55
from pandas import date_range, MultiIndex
66

7-
from .pandas_vb_common import setup # noqa
8-
97

108
class GetLoc(object):
119

@@ -138,3 +136,6 @@ def time_datetime_level_values_copy(self, mi):
138136

139137
def time_datetime_level_values_sliced(self, mi):
140138
mi[:10].values
139+
140+
141+
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/panel_ctor.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from pandas import DataFrame, Panel, DatetimeIndex, date_range
55

6-
from .pandas_vb_common import setup # noqa
6+
from .pandas_vb_common import Panel
77

88

99
class DifferentIndexes(object):
@@ -58,3 +58,6 @@ def setup(self):
5858
def time_from_dict(self):
5959
with warnings.catch_warnings(record=True):
6060
Panel.from_dict(self.data_frames)
61+
62+
63+
from .pandas_vb_common import setup # noqa: F401

0 commit comments

Comments
 (0)