Skip to content

Commit 5be027f

Browse files
authored
Merge pull request #1592 from ColCarroll/fix_travis_build
Actually build on miniconda with python2.7
2 parents 60c7209 + 7b23fb5 commit 5be027f

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

.travis.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
language: python
22

3-
python:
4-
- "2.7"
5-
- "3.5"
6-
73
before_install:
84
- . ./scripts/install_miniconda.sh
95
- "export DISPLAY=:99.0"
@@ -17,10 +13,12 @@ install:
1713
- pip install coveralls
1814

1915
env:
20-
- TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 -e test_examples -e test_distributions" PYTHON_VERSION=${TRAVIS_PYTHON_VERSION}
21-
- TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions pymc3.tests.test_examples" PYTHON_VERSION=${TRAVIS_PYTHON_VERSION}
22-
- TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions_random" PYTHON_VERSION=${TRAVIS_PYTHON_VERSION}
23-
16+
- PYTHON_VERSION=2.7 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 -e test_examples -e test_distributions"
17+
- PYTHON_VERSION=2.7 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions pymc3.tests.test_examples"
18+
- PYTHON_VERSION=2.7 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions_random"
19+
- PYTHON_VERSION=3.5 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 -e test_examples -e test_distributions"
20+
- PYTHON_VERSION=3.5 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions pymc3.tests.test_examples"
21+
- PYTHON_VERSION=3.5 TESTCMD=" -vv --with-timer --with-coverage --cover-package=pymc3 pymc3.tests.test_distributions_random"
2422
script:
2523
- . ./scripts/test.sh $TESTCMD
2624

pymc3/tests/test_distributions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def product(domains, n_samples=-1):
8080
return []
8181
all_vals = [zip(names, val) for val in itertools.product(*[d.vals for d in domains])]
8282
if n_samples > 0 and len(all_vals) > n_samples:
83-
return nr.choice(all_vals, n_samples, replace=False)
83+
return (all_vals[j] for j in nr.choice(len(all_vals), n_samples, replace=False))
8484
return all_vals
8585

8686

@@ -90,7 +90,7 @@ def product(domains, n_samples=-1):
9090
Rminusbig = Domain([-inf, -2, -1.5, -1, -.99, -.9, -.5, -0.01, 0])
9191
Unit = Domain([0, .001, .1, .5, .75, .99, 1])
9292

93-
Circ = Domain([-np.pi -2.1, -1, -.01, .0, .01, 1, 2.1, np.pi])
93+
Circ = Domain([-np.pi, -2.1, -1, -.01, .0, .01, 1, 2.1, np.pi])
9494

9595
Runif = Domain([-1, -.4, 0, .4, 1])
9696
Rdunif = Domain([-10, 0, 10.])

scripts/install_miniconda.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e # fail on first error
44

55
if conda --version > /dev/null 2>&1; then
6-
echo "conda appears to alreaday be installed"
6+
echo "conda appears to already be installed"
77
exit 0
88
fi
99

@@ -22,10 +22,10 @@ DOWNLOAD_PATH="miniconda.sh"
2222

2323
if [ ${PYTHON_VERSION} == "2.7" ]; then
2424
wget http://repo.continuum.io/miniconda/Miniconda-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH};
25-
INSTALL_FOLDER="$HOME/minconda2"
25+
INSTALL_FOLDER="$HOME/miniconda2"
2626
else
2727
wget http://repo.continuum.io/miniconda/Miniconda3-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH};
28-
INSTALL_FOLDER="$HOME/minconda3"
28+
INSTALL_FOLDER="$HOME/miniconda3"
2929
fi
3030

3131

0 commit comments

Comments
 (0)