Skip to content

Commit 25bdb4c

Browse files
committed
Merge master: fix zip-docs conflict
Conflict arose from pandas-dev#22066. Merges up till pandas-dev@d30c4a0
2 parents 9a4dc41 + d30c4a0 commit 25bdb4c

File tree

170 files changed

+6383
-6114
lines changed

Some content is hidden

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

170 files changed

+6383
-6114
lines changed

appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ environment:
2020
matrix:
2121

2222
- CONDA_ROOT: "C:\\Miniconda3_64"
23+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
2324
PYTHON_VERSION: "3.6"
2425
PYTHON_ARCH: "64"
2526
CONDA_PY: "36"
2627
CONDA_NPY: "113"
2728

2829
- CONDA_ROOT: "C:\\Miniconda3_64"
30+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
2931
PYTHON_VERSION: "2.7"
3032
PYTHON_ARCH: "64"
3133
CONDA_PY: "27"

asv_bench/benchmarks/io/csv.py

+32-20
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ def time_frame_date_formatting(self):
5454
self.data.to_csv(self.fname, date_format='%Y%m%d')
5555

5656

57-
class ReadCSVDInferDatetimeFormat(object):
57+
class StringIORewind(object):
58+
59+
def data(self, stringio_object):
60+
stringio_object.seek(0)
61+
return stringio_object
62+
63+
64+
class ReadCSVDInferDatetimeFormat(StringIORewind):
5865

5966
goal_time = 0.2
6067
params = ([True, False], ['custom', 'iso8601', 'ymd'])
@@ -66,10 +73,12 @@ def setup(self, infer_datetime_format, format):
6673
'iso8601': '%Y-%m-%d %H:%M:%S',
6774
'ymd': '%Y%m%d'}
6875
dt_format = formats[format]
69-
self.data = StringIO('\n'.join(rng.strftime(dt_format).tolist()))
76+
self.StringIO_input = StringIO('\n'.join(
77+
rng.strftime(dt_format).tolist()))
7078

7179
def time_read_csv(self, infer_datetime_format, format):
72-
read_csv(self.data, header=None, names=['foo'], parse_dates=['foo'],
80+
read_csv(self.data(self.StringIO_input),
81+
header=None, names=['foo'], parse_dates=['foo'],
7382
infer_datetime_format=infer_datetime_format)
7483

7584

@@ -95,7 +104,7 @@ def time_skipprows(self, skiprows):
95104
read_csv(self.fname, skiprows=skiprows)
96105

97106

98-
class ReadUint64Integers(object):
107+
class ReadUint64Integers(StringIORewind):
99108

100109
goal_time = 0.2
101110

@@ -108,13 +117,13 @@ def setup(self):
108117
self.data2 = StringIO('\n'.join(arr.astype(str).tolist()))
109118

110119
def time_read_uint64(self):
111-
read_csv(self.data1, header=None, names=['foo'])
120+
read_csv(self.data(self.data1), header=None, names=['foo'])
112121

113122
def time_read_uint64_neg_values(self):
114-
read_csv(self.data2, header=None, names=['foo'])
123+
read_csv(self.data(self.data2), header=None, names=['foo'])
115124

116125
def time_read_uint64_na_values(self):
117-
read_csv(self.data1, header=None, names=['foo'],
126+
read_csv(self.data(self.data1), header=None, names=['foo'],
118127
na_values=self.na_values)
119128

120129

@@ -140,19 +149,20 @@ def time_thousands(self, sep, thousands):
140149
read_csv(self.fname, sep=sep, thousands=thousands)
141150

142151

143-
class ReadCSVComment(object):
152+
class ReadCSVComment(StringIORewind):
144153

145154
goal_time = 0.2
146155

147156
def setup(self):
148157
data = ['A,B,C'] + (['1,2,3 # comment'] * 100000)
149-
self.s_data = StringIO('\n'.join(data))
158+
self.StringIO_input = StringIO('\n'.join(data))
150159

151160
def time_comment(self):
152-
read_csv(self.s_data, comment='#', header=None, names=list('abc'))
161+
read_csv(self.data(self.StringIO_input), comment='#',
162+
header=None, names=list('abc'))
153163

154164

155-
class ReadCSVFloatPrecision(object):
165+
class ReadCSVFloatPrecision(StringIORewind):
156166

157167
goal_time = 0.2
158168
params = ([',', ';'], ['.', '_'], [None, 'high', 'round_trip'])
@@ -164,14 +174,14 @@ def setup(self, sep, decimal, float_precision):
164174
rows = sep.join(['0{}'.format(decimal) + '{}'] * 3) + '\n'
165175
data = rows * 5
166176
data = data.format(*floats) * 200 # 1000 x 3 strings csv
167-
self.s_data = StringIO(data)
177+
self.StringIO_input = StringIO(data)
168178

169179
def time_read_csv(self, sep, decimal, float_precision):
170-
read_csv(self.s_data, sep=sep, header=None, names=list('abc'),
171-
float_precision=float_precision)
180+
read_csv(self.data(self.StringIO_input), sep=sep, header=None,
181+
names=list('abc'), float_precision=float_precision)
172182

173183
def time_read_csv_python_engine(self, sep, decimal, float_precision):
174-
read_csv(self.s_data, sep=sep, header=None, engine='python',
184+
read_csv(self.data(self.StringIO_input), sep=sep, header=None, engine='python',
175185
float_precision=None, names=list('abc'))
176186

177187

@@ -193,7 +203,7 @@ def time_convert_direct(self):
193203
read_csv(self.fname, dtype='category')
194204

195205

196-
class ReadCSVParseDates(object):
206+
class ReadCSVParseDates(StringIORewind):
197207

198208
goal_time = 0.2
199209

@@ -206,12 +216,14 @@ def setup(self):
206216
"""
207217
two_cols = ['KORD,19990127'] * 5
208218
data = data.format(*two_cols)
209-
self.s_data = StringIO(data)
219+
self.StringIO_input = StringIO(data)
210220

211221
def time_multiple_date(self):
212-
read_csv(self.s_data, sep=',', header=None,
213-
names=list(string.digits[:9]), parse_dates=[[1, 2], [1, 3]])
222+
read_csv(self.data(self.StringIO_input), sep=',', header=None,
223+
names=list(string.digits[:9]),
224+
parse_dates=[[1, 2], [1, 3]])
214225

215226
def time_baseline(self):
216-
read_csv(self.s_data, sep=',', header=None, parse_dates=[1],
227+
read_csv(self.data(self.StringIO_input), sep=',', header=None,
228+
parse_dates=[1],
217229
names=list(string.digits[:9]))

asv_bench/vbench_to_asv.py

-163
This file was deleted.

ci/environment-dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- Cython>=0.28.2
77
- NumPy
88
- flake8
9+
- flake8-comprehensions
910
- moto
1011
- pytest>=3.1
1112
- python-dateutil>=2.5.0

ci/lint.sh

+6-19
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@ if [ "$LINT" ]; then
1010

1111
# pandas/_libs/src is C code, so no need to search there.
1212
echo "Linting *.py"
13-
flake8 pandas --filename=*.py --exclude pandas/_libs/src
13+
flake8 pandas --filename=*.py --exclude pandas/_libs/src --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
1414
if [ $? -ne "0" ]; then
1515
RET=1
1616
fi
1717
echo "Linting *.py DONE"
1818

1919
echo "Linting setup.py"
20-
flake8 setup.py
20+
flake8 setup.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
2121
if [ $? -ne "0" ]; then
2222
RET=1
2323
fi
2424
echo "Linting setup.py DONE"
2525

2626
echo "Linting asv_bench/benchmarks/"
27-
flake8 asv_bench/benchmarks/ --exclude=asv_bench/benchmarks/*.py --ignore=F811
27+
flake8 asv_bench/benchmarks/ --exclude=asv_bench/benchmarks/*.py --ignore=F811,C405,C406,C408,C409,C410
2828
if [ $? -ne "0" ]; then
2929
RET=1
3030
fi
3131
echo "Linting asv_bench/benchmarks/*.py DONE"
3232

3333
echo "Linting scripts/*.py"
34-
flake8 scripts --filename=*.py
34+
flake8 scripts --filename=*.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
3535
if [ $? -ne "0" ]; then
3636
RET=1
3737
fi
3838
echo "Linting scripts/*.py DONE"
3939

4040
echo "Linting doc scripts"
41-
flake8 doc/make.py doc/source/conf.py
41+
flake8 doc/make.py doc/source/conf.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
4242
if [ $? -ne "0" ]; then
4343
RET=1
4444
fi
4545
echo "Linting doc scripts DONE"
4646

4747
echo "Linting *.pyx"
48-
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403
48+
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C407,C411
4949
if [ $? -ne "0" ]; then
5050
RET=1
5151
fi
@@ -131,19 +131,6 @@ if [ "$LINT" ]; then
131131
fi
132132
echo "Check for non-standard imports DONE"
133133

134-
echo "Check for use of lists instead of generators in built-in Python functions"
135-
136-
# Example: Avoid `any([i for i in some_iterator])` in favor of `any(i for i in some_iterator)`
137-
#
138-
# Check the following functions:
139-
# any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()
140-
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)" pandas
141-
142-
if [ $? = "0" ]; then
143-
RET=1
144-
fi
145-
echo "Check for use of lists instead of generators in built-in Python functions DONE"
146-
147134
echo "Check for incorrect sphinx directives"
148135
SPHINX_DIRECTIVES=$(echo \
149136
"autosummary|contents|currentmodule|deprecated|function|image|"\

ci/travis-27.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies:
99
- fastparquet
1010
- feather-format
1111
- flake8=3.4.1
12+
- flake8-comprehensions
1213
- gcsfs
1314
- html5lib
1415
- ipython

0 commit comments

Comments
 (0)