Skip to content

Commit c71ee2d

Browse files
committed
CI: Run ASV on Travis for failed benchmarks
create asv.sh add to travis Changed file permission Add else statement and asv machine config move to separate travis build CI: Run ASV on Travis for failed benchmarks create asv.sh add to travis move to separate travis build Change build order and change to asv dev Put asv before doc Fix some failing benchmarks Grep for failed benchmarks Add travis wait Don't grep output yet Remove travis_wait for now fix some benchmarks Now grep output add travis wait 40 to ci/asv.sh Add tee Remove wait
1 parent 4618a09 commit c71ee2d

13 files changed

+86
-11
lines changed

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ matrix:
7373
env:
7474
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
7575
# In allow_failures
76+
- dist: trusty
77+
env:
78+
- JOB="3.6_ASV" ASV=true
79+
# In allow_failures
7680
- dist: trusty
7781
env:
7882
- JOB="3.6_DOC" DOC=true
@@ -93,6 +97,9 @@ matrix:
9397
- dist: trusty
9498
env:
9599
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
100+
- dist: trusty
101+
env:
102+
- JOB="3.6_ASV" ASV=true
96103
- dist: trusty
97104
env:
98105
- JOB="3.6_DOC" DOC=true
@@ -128,6 +135,7 @@ script:
128135
- ci/script_single.sh
129136
- ci/script_multi.sh
130137
- ci/lint.sh
138+
- ci/asv.sh
131139
- echo "checking imports"
132140
- source activate pandas && python ci/check_imports.py
133141
- echo "script done"

asv_bench/benchmarks/frame_methods.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class Repr(object):
141141
def setup(self):
142142
nrows = 10000
143143
data = np.random.randn(nrows, 10)
144-
idx = MultiIndex.from_arrays(np.tile(np.random.randn(3, nrows / 100),
145-
100))
144+
arrays = np.tile(np.random.randn(3, int(nrows / 100)), 100)
145+
idx = MultiIndex.from_arrays(arrays)
146146
self.df3 = DataFrame(data, index=idx)
147147
self.df4 = DataFrame(data, index=np.random.randn(nrows))
148148
self.df_tall = DataFrame(np.random.randn(nrows, 10))

asv_bench/benchmarks/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class SumMultiLevel(object):
467467

468468
def setup(self):
469469
N = 50
470-
self.df = DataFrame({'A': range(N) * 2,
470+
self.df = DataFrame({'A': list(range(N)) * 2,
471471
'B': range(N * 2),
472472
'C': 1}).set_index(['A', 'B'])
473473

asv_bench/benchmarks/indexing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def setup(self):
295295
def time_insert(self):
296296
np.random.seed(1234)
297297
for i in range(100):
298-
self.df.insert(0, i, np.random.randn(self.N))
298+
self.df.insert(0, i, np.random.randn(self.N),
299+
allow_duplicates=True)
299300

300301
def time_assign_with_setitem(self):
301302
np.random.seed(1234)

asv_bench/benchmarks/reindex.py

-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ def setup(self):
167167
col_array2 = col_array.copy()
168168
col_array2[:, :10000] = np.nan
169169
self.col_array_list = list(col_array)
170-
self.col_array_list2 = list(col_array2)
171170

172171
def time_lib_fast_zip(self):
173172
lib.fast_zip(self.col_array_list)
174-
175-
def time_lib_fast_zip_fillna(self):
176-
lib.fast_zip_fillna(self.col_array_list2)

asv_bench/benchmarks/reshape.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ def setup(self):
104104
self.letters = list('ABCD')
105105
yrvars = [l + str(num)
106106
for l, num in product(self.letters, range(1, nyrs + 1))]
107-
107+
columns = [str(i) for i in range(nidvars)] + yrvars
108108
self.df = DataFrame(np.random.randn(N, nidvars + len(yrvars)),
109-
columns=list(range(nidvars)) + yrvars)
109+
columns=columns)
110110
self.df['id'] = self.df.index
111111

112112
def time_wide_to_long_big(self):

asv_bench/benchmarks/timeseries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class ToDatetimeCache(object):
365365

366366
def setup(self, cache):
367367
N = 10000
368-
self.unique_numeric_seconds = range(N)
368+
self.unique_numeric_seconds = list(range(N))
369369
self.dup_numeric_seconds = [1000] * N
370370
self.dup_string_dates = ['2000-02-11'] * N
371371
self.dup_string_with_tz = ['2000-02-11 15:00:00-0800'] * N

ci/asv.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
echo "inside $0"
4+
5+
source activate pandas
6+
7+
if [ "$ASV" ]; then
8+
echo "Check for failed asv benchmarks"
9+
10+
cd asv_bench
11+
12+
asv machine --yes
13+
14+
RET=0
15+
16+
time asv dev | tee >(grep "failed")
17+
18+
if [ $? = "0" ]; then
19+
RET=1
20+
fi
21+
echo "Check for failed asv benchmarks DONE"
22+
else
23+
RET=0
24+
echo "NOT checking for failed asv benchmarks"
25+
fi
26+
27+
exit $RET

ci/requirements-3.6_ASV.build

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python=3.6*
2+
python-dateutil
3+
pytz
4+
numpy=1.13*
5+
cython

ci/requirements-3.6_ASV.run

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ipython
2+
ipykernel
3+
ipywidgets
4+
sphinx=1.5*
5+
nbconvert
6+
nbformat
7+
notebook
8+
matplotlib
9+
seaborn
10+
scipy
11+
lxml
12+
beautifulsoup4
13+
html5lib
14+
pytables
15+
python-snappy
16+
openpyxl
17+
xlrd
18+
xlwt
19+
xlsxwriter
20+
sqlalchemy
21+
numexpr
22+
bottleneck
23+
statsmodels
24+
xarray
25+
pyqt

ci/requirements-3.6_ASV.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "[install ASV_BUILD deps]"
6+
7+
pip install git+https://github.com/spacetelescope/asv

ci/script_multi.sh

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ if [ "$PIP_BUILD_TEST" ] || [ "$CONDA_BUILD_TEST" ]; then
3737
elif [ "$DOC" ]; then
3838
echo "We are not running pytest as this is a doc-build"
3939

40+
elif [ "$ASV" ]; then
41+
echo "We are not running pytest as this is an asv-build"
42+
4043
elif [ "$COVERAGE" ]; then
4144
echo pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml --strict $TEST_ARGS pandas
4245
pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml --strict $TEST_ARGS pandas

ci/script_single.sh

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [ "$PIP_BUILD_TEST" ] || [ "$CONDA_BUILD_TEST" ]; then
2222
elif [ "$DOC" ]; then
2323
echo "We are not running pytest as this is a doc-build"
2424

25+
elif [ "$ASV" ]; then
26+
echo "We are not running pytest as this is an asv-build"
27+
2528
elif [ "$COVERAGE" ]; then
2629
echo pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
2730
pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas

0 commit comments

Comments
 (0)