Skip to content

Commit 7c59b88

Browse files
Merge branch 'master' into master
2 parents 7152142 + 296c251 commit 7c59b88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1315
-989
lines changed

.pep8speaks.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33
scanner:
44
diff_only: True # If True, errors caused by only the patch are shown
55

6+
# Opened issue in pep8speaks, so we can directly use the config in setup.cfg
7+
# (and avoid having to duplicate it here):
8+
# https://github.com/OrkoHunter/pep8speaks/issues/95
9+
610
pycodestyle:
711
max-line-length: 79
8-
ignore: # Errors and warnings to ignore
12+
ignore:
13+
- W503, # line break before binary operator
914
- E402, # module level import not at top of file
15+
- E722, # do not use bare except
1016
- E731, # do not assign a lambda expression, use a def
11-
- W503 # line break before binary operator
17+
- E741, # ambiguous variable name 'l'
18+
- C406, # Unnecessary list literal - rewrite as a dict literal.
19+
- C408, # Unnecessary dict call - rewrite as a literal.
20+
- C409 # Unnecessary list passed to tuple() - rewrite as a tuple literal.

.travis.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ matrix:
4545
- language-pack-zh-hans
4646
- dist: trusty
4747
env:
48-
- JOB="2.7, lint" ENV_FILE="ci/travis-27.yaml" TEST_ARGS="--skip-slow" LINT=true
48+
- JOB="2.7" ENV_FILE="ci/travis-27.yaml" TEST_ARGS="--skip-slow"
4949
addons:
5050
apt:
5151
packages:
5252
- python-gtk2
5353
- dist: trusty
5454
env:
55-
- JOB="3.6, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true DOCTEST=true
56-
55+
- JOB="3.6, lint, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
5756
- dist: trusty
5857
env:
5958
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
@@ -109,11 +108,7 @@ script:
109108
- ci/run_build_docs.sh
110109
- ci/script_single.sh
111110
- ci/script_multi.sh
112-
- ci/lint.sh
113-
- ci/doctests.sh
114-
- echo "checking imports"
115-
- source activate pandas && python ci/check_imports.py
116-
- echo "script done"
111+
- ci/code_checks.sh
117112

118113
after_success:
119114
- ci/upload_coverage.sh

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

0 commit comments

Comments
 (0)