Skip to content

Commit a2f55bb

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
1 parent 250574e commit a2f55bb

11 files changed

+83
-5
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+
- travis_wait 50 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/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

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