Skip to content

Commit

Permalink
STYLE: Fixed linting of benchmarks (#22947)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerod Estapa authored and datapythonista committed Oct 10, 2018
1 parent e5ed297 commit 296c251
Show file tree
Hide file tree
Showing 34 changed files with 119 additions and 57 deletions.
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
except (ImportError, TypeError, ValueError):
pass

from .pandas_vb_common import setup # noqa


class Factorize(object):

Expand Down Expand Up @@ -126,3 +124,6 @@ def time_series_timedeltas(self, df):

def time_series_dates(self, df):
hashing.hash_pandas_object(df['dates'])


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/attrs_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
except ImportError:
from pandas.util.decorators import cache_readonly

from .pandas_vb_common import setup # noqa


class DataFrameAttributes(object):

Expand Down Expand Up @@ -38,3 +36,6 @@ def prop(self):

def time_cache_readonly(self):
self.obj.prop


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/binary_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
except ImportError:
import pandas.computation.expressions as expr

from .pandas_vb_common import setup # noqa


class Ops(object):

Expand Down Expand Up @@ -149,3 +147,6 @@ def time_add_overflow_b_mask_nan(self):
def time_add_overflow_both_arg_nan(self):
checked_add_with_arr(self.arr, self.arr_mixed, arr_mask=self.arr_nan_1,
b_mask=self.arr_nan_2)


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
except ImportError:
pass

from .pandas_vb_common import setup # noqa


class Concat(object):

Expand Down Expand Up @@ -245,3 +243,6 @@ def time_getitem_list(self, index):

def time_getitem_bool_array(self, index):
self.data[self.data == self.cat_scalar]


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import pandas.util.testing as tm
from pandas import Series, Index, DatetimeIndex, Timestamp, MultiIndex

from .pandas_vb_common import setup # noqa


class SeriesConstructors(object):

Expand Down Expand Up @@ -64,3 +62,6 @@ def setup(self):

def time_multiindex_from_iterables(self):
MultiIndex.from_product(self.iterables)


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
except ImportError:
import pandas.computation.expressions as expr

from .pandas_vb_common import setup # noqa


class Eval(object):

Expand Down Expand Up @@ -65,3 +63,6 @@ def time_query_datetime_column(self):

def time_query_with_boolean_selection(self):
self.df.query('(a >= @self.min_val) & (a <= @self.max_val)')


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/frame_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# For compatibility with older versions
from pandas.core.datetools import * # noqa

from .pandas_vb_common import setup # noqa


class FromDicts(object):

Expand Down Expand Up @@ -99,3 +97,6 @@ def setup(self):

def time_frame_from_ndarray(self):
self.df = DataFrame(self.data)


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
isnull, NaT)

from .pandas_vb_common import setup # noqa


class GetNumericData(object):

Expand Down Expand Up @@ -537,3 +535,6 @@ def time_series_describe(self):

def time_dataframe_describe(self):
self.df.describe()


from .pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/gil.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def wrapper(fname):
return fname
return wrapper

from .pandas_vb_common import BaseIO, setup # noqa
from .pandas_vb_common import BaseIO


class ParallelGroupbyMethods(object):
Expand Down Expand Up @@ -273,3 +273,6 @@ def time_parallel(self, threads):
def time_loop(self, threads):
for i in range(threads):
self.loop()


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
TimeGrouper, Categorical, Timestamp)
import pandas.util.testing as tm

from .pandas_vb_common import setup # noqa


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

def time_first(self):
self.df_nans.groupby('key').transform('first')


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/index_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from pandas import (Series, date_range, DatetimeIndex, Index, RangeIndex,
Float64Index)

from .pandas_vb_common import setup # noqa


class SetOperations(object):

Expand Down Expand Up @@ -192,3 +190,6 @@ def setup(self):

def time_get_loc(self):
self.ind.get_loc(0)


from .pandas_vb_common import setup # noqa: F401
11 changes: 7 additions & 4 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import numpy as np
import pandas.util.testing as tm
from pandas import (Series, DataFrame, MultiIndex, Panel,
Int64Index, Float64Index, IntervalIndex,
CategoricalIndex, IndexSlice, concat, date_range)
from .pandas_vb_common import setup # noqa
from pandas import (Series, DataFrame, MultiIndex, Int64Index, Float64Index,
IntervalIndex, CategoricalIndex,
IndexSlice, concat, date_range)
from .pandas_vb_common import Panel


class NumericSeriesIndexing(object):
Expand Down Expand Up @@ -367,3 +367,6 @@ def time_assign_with_setitem(self):
np.random.seed(1234)
for i in range(100):
self.df[i] = np.random.randn(self.N)


from .pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas.util.testing as tm
from pandas import DataFrame, Series, to_numeric

from .pandas_vb_common import numeric_dtypes, lib, setup # noqa
from .pandas_vb_common import numeric_dtypes, lib


class NumericInferOps(object):
Expand Down Expand Up @@ -111,3 +111,6 @@ def setup_cache(self):

def time_convert(self, data):
lib.maybe_convert_numeric(data, set(), coerce_numeric=False)


from .pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pandas import DataFrame, Categorical, date_range, read_csv
from pandas.compat import cStringIO as StringIO

from ..pandas_vb_common import setup, BaseIO # noqa
from ..pandas_vb_common import BaseIO


class ToCSV(BaseIO):
Expand Down Expand Up @@ -225,3 +225,6 @@ def time_baseline(self):
read_csv(self.data(self.StringIO_input), sep=',', header=None,
parse_dates=[1],
names=list(string.digits[:9]))


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pandas.compat import BytesIO
import pandas.util.testing as tm

from ..pandas_vb_common import BaseIO, setup # noqa
from ..pandas_vb_common import BaseIO


class Excel(object):
Expand Down Expand Up @@ -34,3 +34,6 @@ def time_write_excel(self, engine):
writer_write = ExcelWriter(bio_write, engine=engine)
self.df.to_excel(writer_write, sheet_name='Sheet1')
writer_write.save()


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pandas import DataFrame, Panel, date_range, HDFStore, read_hdf
import pandas.util.testing as tm

from ..pandas_vb_common import BaseIO, setup # noqa
from ..pandas_vb_common import BaseIO


class HDFStoreDataFrame(BaseIO):
Expand Down Expand Up @@ -149,3 +149,6 @@ def time_read_hdf(self, format):

def time_write_hdf(self, format):
self.df.to_hdf(self.fname, 'df', format=format)


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas.util.testing as tm
from pandas import DataFrame, date_range, timedelta_range, concat, read_json

from ..pandas_vb_common import setup, BaseIO # noqa
from ..pandas_vb_common import BaseIO


class ReadJSON(BaseIO):
Expand Down Expand Up @@ -125,3 +125,6 @@ def time_float_int_lines(self, orient):

def time_float_int_str_lines(self, orient):
self.df_int_float_str.to_json(self.fname, orient='records', lines=True)


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/msgpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pandas import DataFrame, date_range, read_msgpack
import pandas.util.testing as tm

from ..pandas_vb_common import BaseIO, setup # noqa
from ..pandas_vb_common import BaseIO


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

def time_write_msgpack(self):
self.df.to_msgpack(self.fname)


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pandas import DataFrame, date_range, read_pickle
import pandas.util.testing as tm

from ..pandas_vb_common import BaseIO, setup # noqa
from ..pandas_vb_common import BaseIO


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

def time_write_pickle(self):
self.df.to_pickle(self.fname)


from ..pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from pandas import DataFrame, date_range, read_sql_query, read_sql_table
from sqlalchemy import create_engine

from ..pandas_vb_common import setup # noqa


class SQL(object):

Expand Down Expand Up @@ -130,3 +128,6 @@ def setup(self, dtype):

def time_read_sql_table_column(self, dtype):
read_sql_table(self.table_name, self.con, columns=[dtype])


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pandas import DataFrame, date_range, read_stata
import pandas.util.testing as tm

from ..pandas_vb_common import BaseIO, setup # noqa
from ..pandas_vb_common import BaseIO


class Stata(BaseIO):
Expand Down Expand Up @@ -35,3 +35,6 @@ def time_read_stata(self, convert_dates):

def time_write_stata(self, convert_dates):
self.df.to_stata(self.fname, self.convert_dates)


from ..pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/join_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except ImportError:
from pandas import ordered_merge as merge_ordered

from .pandas_vb_common import setup # noqa
from .pandas_vb_common import Panel


class Append(object):
Expand Down Expand Up @@ -361,3 +361,6 @@ def time_series_align_int64_index(self):

def time_series_align_left_monotonic(self):
self.ts1.align(self.ts2, join='left')


from .pandas_vb_common import setup # noqa: F401
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/multiindex_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import pandas.util.testing as tm
from pandas import date_range, MultiIndex

from .pandas_vb_common import setup # noqa


class GetLoc(object):

Expand Down Expand Up @@ -138,3 +136,6 @@ def time_datetime_level_values_copy(self, mi):

def time_datetime_level_values_sliced(self, mi):
mi[:10].values


from .pandas_vb_common import setup # noqa: F401
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/panel_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pandas import DataFrame, Panel, DatetimeIndex, date_range

from .pandas_vb_common import setup # noqa
from .pandas_vb_common import Panel


class DifferentIndexes(object):
Expand Down Expand Up @@ -58,3 +58,6 @@ def setup(self):
def time_from_dict(self):
with warnings.catch_warnings(record=True):
Panel.from_dict(self.data_frames)


from .pandas_vb_common import setup # noqa: F401
Loading

0 comments on commit 296c251

Please sign in to comment.