From cc62d21a043669fcd21ec388eaa6fd3d02b2bb39 Mon Sep 17 00:00:00 2001 From: Andrew Gaspari Date: Thu, 31 Jan 2019 14:21:12 -0600 Subject: [PATCH 1/3] CLN: isort from attrs_caching.py to eval.py --- asv_bench/benchmarks/attrs_caching.py | 4 +++- asv_bench/benchmarks/binary_ops.py | 4 +++- asv_bench/benchmarks/categoricals.py | 4 +++- asv_bench/benchmarks/ctors.py | 5 +++-- asv_bench/benchmarks/dtypes.py | 8 ++++---- asv_bench/benchmarks/eval.py | 4 +++- setup.cfg | 6 ------ 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/asv_bench/benchmarks/attrs_caching.py b/asv_bench/benchmarks/attrs_caching.py index d061755208c9e..fb0f1030d46eb 100644 --- a/asv_bench/benchmarks/attrs_caching.py +++ b/asv_bench/benchmarks/attrs_caching.py @@ -1,5 +1,7 @@ import numpy as np + from pandas import DataFrame + try: from pandas.util import cache_readonly except ImportError: @@ -34,4 +36,4 @@ def time_cache_readonly(self): self.obj.prop -from .pandas_vb_common import setup # noqa: F401 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/asv_bench/benchmarks/binary_ops.py b/asv_bench/benchmarks/binary_ops.py index 22b8ed80f3d07..055f060bfc546 100644 --- a/asv_bench/benchmarks/binary_ops.py +++ b/asv_bench/benchmarks/binary_ops.py @@ -1,6 +1,8 @@ import numpy as np + from pandas import DataFrame, Series, date_range from pandas.core.algorithms import checked_add_with_arr + try: import pandas.core.computation.expressions as expr except ImportError: @@ -152,4 +154,4 @@ def time_add_overflow_both_arg_nan(self): b_mask=self.arr_nan_2) -from .pandas_vb_common import setup # noqa: F401 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/asv_bench/benchmarks/categoricals.py b/asv_bench/benchmarks/categoricals.py index 4b5b2848f7e0f..6a0bac25c48cc 100644 --- a/asv_bench/benchmarks/categoricals.py +++ b/asv_bench/benchmarks/categoricals.py @@ -1,8 +1,10 @@ import warnings import numpy as np + import pandas as pd import pandas.util.testing as tm + try: from pandas.api.types import union_categoricals except ImportError: @@ -293,4 +295,4 @@ def time_sort_values(self): self.index.sort_values(ascending=False) -from .pandas_vb_common import setup # noqa: F401 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/asv_bench/benchmarks/ctors.py b/asv_bench/benchmarks/ctors.py index 5715c4fb2d0d4..97a9a7872a530 100644 --- a/asv_bench/benchmarks/ctors.py +++ b/asv_bench/benchmarks/ctors.py @@ -1,6 +1,7 @@ import numpy as np + +from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp import pandas.util.testing as tm -from pandas import Series, Index, DatetimeIndex, Timestamp, MultiIndex def no_change(arr): @@ -100,4 +101,4 @@ def time_multiindex_from_iterables(self): MultiIndex.from_product(self.iterables) -from .pandas_vb_common import setup # noqa: F401 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/asv_bench/benchmarks/dtypes.py b/asv_bench/benchmarks/dtypes.py index e59154cd99965..651998178b07a 100644 --- a/asv_bench/benchmarks/dtypes.py +++ b/asv_bench/benchmarks/dtypes.py @@ -1,9 +1,9 @@ +import numpy as np + from pandas.api.types import pandas_dtype -import numpy as np from .pandas_vb_common import ( - numeric_dtypes, datetime_dtypes, string_dtypes, extension_dtypes) - + datetime_dtypes, extension_dtypes, numeric_dtypes, string_dtypes) _numpy_dtypes = [np.dtype(dtype) for dtype in (numeric_dtypes + @@ -36,4 +36,4 @@ def time_pandas_dtype_invalid(self, dtype): pass -from .pandas_vb_common import setup # noqa: F401 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/asv_bench/benchmarks/eval.py b/asv_bench/benchmarks/eval.py index 68df38cd50742..4a1dc6421a41a 100644 --- a/asv_bench/benchmarks/eval.py +++ b/asv_bench/benchmarks/eval.py @@ -1,5 +1,7 @@ import numpy as np + import pandas as pd + try: import pandas.core.computation.expressions as expr except ImportError: @@ -61,4 +63,4 @@ 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 +from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/setup.cfg b/setup.cfg index b15c3ce8a110a..301976645e9ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -114,11 +114,6 @@ force_sort_within_sections=True skip= pandas/core/api.py, pandas/core/frame.py, - asv_bench/benchmarks/attrs_caching.py, - asv_bench/benchmarks/binary_ops.py, - asv_bench/benchmarks/categoricals.py, - asv_bench/benchmarks/ctors.py, - asv_bench/benchmarks/eval.py, asv_bench/benchmarks/frame_ctor.py, asv_bench/benchmarks/frame_methods.py, asv_bench/benchmarks/gil.py, @@ -149,6 +144,5 @@ skip= asv_bench/benchmarks/timeseries.py asv_bench/benchmarks/pandas_vb_common.py asv_bench/benchmarks/offset.py - asv_bench/benchmarks/dtypes.py asv_bench/benchmarks/strings.py asv_bench/benchmarks/period.py From d0bb95bea52f255db5d644f924e17ffadc0d12aa Mon Sep 17 00:00:00 2001 From: Andrew Gaspari Date: Thu, 31 Jan 2019 15:14:12 -0600 Subject: [PATCH 2/3] CLN: return dtypes to original after test errors --- asv_bench/benchmarks/dtypes.py | 8 ++++---- setup.cfg | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/asv_bench/benchmarks/dtypes.py b/asv_bench/benchmarks/dtypes.py index 651998178b07a..e59154cd99965 100644 --- a/asv_bench/benchmarks/dtypes.py +++ b/asv_bench/benchmarks/dtypes.py @@ -1,9 +1,9 @@ -import numpy as np - from pandas.api.types import pandas_dtype +import numpy as np from .pandas_vb_common import ( - datetime_dtypes, extension_dtypes, numeric_dtypes, string_dtypes) + numeric_dtypes, datetime_dtypes, string_dtypes, extension_dtypes) + _numpy_dtypes = [np.dtype(dtype) for dtype in (numeric_dtypes + @@ -36,4 +36,4 @@ def time_pandas_dtype_invalid(self, dtype): pass -from .pandas_vb_common import setup # noqa: F401 isort:skip +from .pandas_vb_common import setup # noqa: F401 diff --git a/setup.cfg b/setup.cfg index 301976645e9ca..2a6feff09d1ae 100644 --- a/setup.cfg +++ b/setup.cfg @@ -114,6 +114,7 @@ force_sort_within_sections=True skip= pandas/core/api.py, pandas/core/frame.py, + asv_bench/benchmarks/dtypes.py, asv_bench/benchmarks/frame_ctor.py, asv_bench/benchmarks/frame_methods.py, asv_bench/benchmarks/gil.py, From 689e8bd066547c9942857f8259a96a90da95ad07 Mon Sep 17 00:00:00 2001 From: Andrew Gaspari Date: Sat, 9 Mar 2019 11:58:30 -0600 Subject: [PATCH 3/3] CLN: remove isort:skip per benchmark fix --- asv_bench/benchmarks/attrs_caching.py | 2 +- asv_bench/benchmarks/binary_ops.py | 2 +- asv_bench/benchmarks/categoricals.py | 2 +- asv_bench/benchmarks/ctors.py | 2 +- asv_bench/benchmarks/eval.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asv_bench/benchmarks/attrs_caching.py b/asv_bench/benchmarks/attrs_caching.py index fb0f1030d46eb..b85a2018a1c45 100644 --- a/asv_bench/benchmarks/attrs_caching.py +++ b/asv_bench/benchmarks/attrs_caching.py @@ -36,4 +36,4 @@ def time_cache_readonly(self): self.obj.prop -from .pandas_vb_common import setup # noqa: F401 isort:skip +from .pandas_vb_common import setup # noqa: F401 diff --git a/asv_bench/benchmarks/binary_ops.py b/asv_bench/benchmarks/binary_ops.py index 055f060bfc546..0f7909bb6d734 100644 --- a/asv_bench/benchmarks/binary_ops.py +++ b/asv_bench/benchmarks/binary_ops.py @@ -154,4 +154,4 @@ def time_add_overflow_both_arg_nan(self): b_mask=self.arr_nan_2) -from .pandas_vb_common import setup # noqa: F401 isort:skip +from .pandas_vb_common import setup # noqa: F401 diff --git a/asv_bench/benchmarks/categoricals.py b/asv_bench/benchmarks/categoricals.py index 6a0bac25c48cc..c6f1ec4706e5c 100644 --- a/asv_bench/benchmarks/categoricals.py +++ b/asv_bench/benchmarks/categoricals.py @@ -295,4 +295,4 @@ def time_sort_values(self): self.index.sort_values(ascending=False) -from .pandas_vb_common import setup # noqa: F401 isort:skip +from .pandas_vb_common import setup # noqa: F401 diff --git a/asv_bench/benchmarks/ctors.py b/asv_bench/benchmarks/ctors.py index 97a9a7872a530..a68fdb12f8a38 100644 --- a/asv_bench/benchmarks/ctors.py +++ b/asv_bench/benchmarks/ctors.py @@ -101,4 +101,4 @@ def time_multiindex_from_iterables(self): MultiIndex.from_product(self.iterables) -from .pandas_vb_common import setup # noqa: F401 isort:skip +from .pandas_vb_common import setup # noqa: F401 diff --git a/asv_bench/benchmarks/eval.py b/asv_bench/benchmarks/eval.py index 4a1dc6421a41a..82b0625961a80 100644 --- a/asv_bench/benchmarks/eval.py +++ b/asv_bench/benchmarks/eval.py @@ -63,4 +63,4 @@ 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 isort:skip +from .pandas_vb_common import setup # noqa: F401