From 1ee7a30636f547fcc3c1fcf038736521096aa34e Mon Sep 17 00:00:00 2001 From: Luciano Paz Date: Tue, 7 May 2019 10:27:00 +0200 Subject: [PATCH 01/12] Added minimal python3.5 test env --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 432216fb3a..da8eaadde3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,8 @@ env: - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - PYTHON_VERSION=3.5 FLOATX='float64' TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" script: - . ./scripts/test.sh $TESTCMD From 77973149531c29db51d43f93d2b99650d2e07535 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Tue, 7 May 2019 14:00:27 +0200 Subject: [PATCH 02/12] Enforced python3.5 with matrix. Used different conda env in py35. --- .travis.yml | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index da8eaadde3..2fb3799a5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,36 @@ cache: - $HOME/.theano - $HOME/miniconda3 +matrix: + include: + - name: "Python 3.6 float32 testset1" + python: 3.6 + env: FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" + - name: "Python 3.6 float32 testset2" + python: 3.6 + env: FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" + - name: "Python 3.6 float32 testset3" + python: 3.6 + env: FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" + - name: "Python 3.6 float32 testset4" + python: 3.6 + env: FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - name: "Python 3.6 float64 testset1" + python: 3.6 + env: FLOATX='float64' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" + - name: "Python 3.6 float64 testset2" + python: 3.6 + env: FLOATX='float64' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" + - name: "Python 3.6 float64 testset3" + python: 3.6 + env: FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" + - name: "Python 3.6 float64 testset4" + python: 3.6 + env: FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - name: "Python 3.5 float64 minitestset" + python: 3.5 + env: PYTHON_VERSION=3.5 FLOATX='float64' ENVNAME="py35_testenv" TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" + addons: apt_packages: - pandoc @@ -21,18 +51,6 @@ install: - pip install coveralls - conda list && pip freeze -env: - - FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" - - FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - PYTHON_VERSION=3.5 FLOATX='float64' TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" - script: - . ./scripts/test.sh $TESTCMD - . ./scripts/confirm_mpl_optional.sh From 24a7110e67cfa267d0df6a51c05a7c520adf4b15 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Tue, 7 May 2019 15:34:19 +0200 Subject: [PATCH 03/12] Reverted travis.yml matrix back to envs. Set default ENVNAME --- .travis.yml | 42 +++++++++++---------------------------- scripts/create_testenv.sh | 2 +- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2fb3799a5b..8ced253370 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,36 +6,6 @@ cache: - $HOME/.theano - $HOME/miniconda3 -matrix: - include: - - name: "Python 3.6 float32 testset1" - python: 3.6 - env: FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" - - name: "Python 3.6 float32 testset2" - python: 3.6 - env: FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - name: "Python 3.6 float32 testset3" - python: 3.6 - env: FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - - name: "Python 3.6 float32 testset4" - python: 3.6 - env: FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - name: "Python 3.6 float64 testset1" - python: 3.6 - env: FLOATX='float64' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" - - name: "Python 3.6 float64 testset2" - python: 3.6 - env: FLOATX='float64' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - name: "Python 3.6 float64 testset3" - python: 3.6 - env: FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - - name: "Python 3.6 float64 testset4" - python: 3.6 - env: FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - name: "Python 3.5 float64 minitestset" - python: 3.5 - env: PYTHON_VERSION=3.5 FLOATX='float64' ENVNAME="py35_testenv" TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" - addons: apt_packages: - pandoc @@ -51,6 +21,18 @@ install: - pip install coveralls - conda list && pip freeze +env: + - FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" + - FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" + - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" + - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" + - PYTHON_VERSION=3.5 FLOATX='float64' ENVNAME="py35_testenv" TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" + script: - . ./scripts/test.sh $TESTCMD - . ./scripts/confirm_mpl_optional.sh diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 7604fc330e..96a6d3ed05 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -20,7 +20,7 @@ command -v conda >/dev/null 2>&1 || { exit 1; } -ENVNAME="testenv" +ENVNAME="${ENVNAME:-testenv}" # if no ENVNAME is specified, use testenv PYTHON_VERSION=${PYTHON_VERSION:-3.6} # if no python specified, use 3.6 if [ -z ${GLOBAL} ] From 4cdce65a5005af3009b7b390c5f6e61af852d62b Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Tue, 7 May 2019 15:38:13 +0200 Subject: [PATCH 04/12] Removed duplicate env --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8ced253370..f544cdd945 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,6 @@ env: - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py" - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - PYTHON_VERSION=3.5 FLOATX='float64' ENVNAME="py35_testenv" TESTCMD="--cov-append pymc3/tests/test_sampling.py pymc3/tests/test_model_graph.py" script: From 7f9b16182f8dab6cc7d93682128db398ea59c9e1 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Tue, 7 May 2019 18:55:06 +0200 Subject: [PATCH 05/12] Try to pip uninstall conflicting numpy version before conda installing into the env --- scripts/create_testenv.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 96a6d3ed05..fc32339481 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -33,10 +33,12 @@ then fi source activate ${ENVNAME} fi +pip install --upgrade pip +pip uninstall numpy + conda install --yes numpy scipy mkl-service conda install --yes -c conda-forge python-graphviz -pip install --upgrade pip # Install editable using the setup.py From c445227e2cbb2580362ecb1e0054464c4d93385d Mon Sep 17 00:00:00 2001 From: Luciano Paz Date: Tue, 7 May 2019 20:42:02 +0200 Subject: [PATCH 06/12] Confirm pip uninstall numpy --- scripts/create_testenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index fc32339481..d738962e93 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -34,7 +34,7 @@ then source activate ${ENVNAME} fi pip install --upgrade pip -pip uninstall numpy +pip uninstall -y numpy conda install --yes numpy scipy mkl-service conda install --yes -c conda-forge python-graphviz From 18ddfbcd067476d6c9f554e1af354585baab13d9 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Wed, 8 May 2019 13:41:59 +0200 Subject: [PATCH 07/12] Try to uninstall numpy in install_miniconda --- scripts/install_miniconda.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install_miniconda.sh b/scripts/install_miniconda.sh index 6db6f64934..72c6d7245d 100755 --- a/scripts/install_miniconda.sh +++ b/scripts/install_miniconda.sh @@ -46,3 +46,4 @@ fi export PATH="$INSTALL_FOLDER/bin:$PATH" echo "Adding $INSTALL_FOLDER to PATH. Consider adding it in your .rc file as well." conda update -q -y conda +pip uninstall -y numpy From 3719cd4c33f0313659d23f73cacd35db2936bead Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Wed, 8 May 2019 14:37:01 +0200 Subject: [PATCH 08/12] Try to not conda install numpy and hope pip does everything well --- scripts/create_testenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index d738962e93..3b398a8b48 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -36,7 +36,7 @@ fi pip install --upgrade pip pip uninstall -y numpy -conda install --yes numpy scipy mkl-service +conda install --yes mkl-service conda install --yes -c conda-forge python-graphviz From 1c145aada069f177d76f88682f39d3a5649f6a94 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Thu, 9 May 2019 10:45:45 +0200 Subject: [PATCH 09/12] Fixed test error on py35 env --- RELEASE-NOTES.md | 1 + pymc3/distributions/distribution.py | 1 + scripts/create_testenv.sh | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 1fe060bef1..51f2376f7d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -45,6 +45,7 @@ - Fixed an issue in `model_graph` that caused construction of the graph of the model for rendering to hang: replaced a search over the powerset of the nodes with a breadth-first search over the nodes. Fix for #3458. - Removed variable annotations from `model_graph` but left type hints (Fix for #3465). This means that we support `python>=3.5.4`. - Default `target_accept`for `HamiltonianMC` is now 0.65, as suggested in Beskos et. al. 2010 and Neal 2001. +- Fixed bug in `draw_values` that lead to intermittent errors in python3.5. This happened with some deterministic nodes that were drawn but not added to `givens`. ### Deprecations diff --git a/pymc3/distributions/distribution.py b/pymc3/distributions/distribution.py index 0164ff691d..ff60e677b9 100644 --- a/pymc3/distributions/distribution.py +++ b/pymc3/distributions/distribution.py @@ -418,6 +418,7 @@ def draw_values(params, point=None, size=None): param = params[param_idx] if (param, size) in drawn: evaluated[param_idx] = drawn[(param, size)] + givens[param.name] = (param, value) else: try: # might evaluate in a bad order, value = _draw_value(param, diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 3b398a8b48..8970f0e675 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -34,7 +34,6 @@ then source activate ${ENVNAME} fi pip install --upgrade pip -pip uninstall -y numpy conda install --yes mkl-service conda install --yes -c conda-forge python-graphviz From b9f960ac3d228f839a1ed161cbd02fe060406c1b Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Thu, 9 May 2019 13:56:30 +0200 Subject: [PATCH 10/12] Fixed defects introduced to draw_values --- pymc3/distributions/distribution.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pymc3/distributions/distribution.py b/pymc3/distributions/distribution.py index ff60e677b9..b455480e36 100644 --- a/pymc3/distributions/distribution.py +++ b/pymc3/distributions/distribution.py @@ -401,8 +401,7 @@ def draw_values(params, point=None, size=None): # nodes in the `params` list. stack.extend([node for node in named_nodes_parents[next_] if node is not None and - (node, size) not in drawn and - node not in params]) + (node, size) not in drawn]) # the below makes sure the graph is evaluated in order # test_distributions_random::TestDrawValues::test_draw_order fails without it @@ -418,9 +417,22 @@ def draw_values(params, point=None, size=None): param = params[param_idx] if (param, size) in drawn: evaluated[param_idx] = drawn[(param, size)] - givens[param.name] = (param, value) else: try: # might evaluate in a bad order, + # Sometimes _draw_value recurrently calls draw_values. + # This may set values for certain nodes in the drawn + # dictionary, but they don't get added to the givens + # dictionary. Here, we try to fix that. + if param in named_nodes_children: + for node in named_nodes_children[param]: + if ( + node.name not in givens and + (node, size) in drawn + ): + givens[node.name] = ( + node, + drawn[(node, size)] + ) value = _draw_value(param, point=point, givens=givens.values(), From cee40d7003fe61def9c4c17a4de25d9be57e1337 Mon Sep 17 00:00:00 2001 From: Luciano Paz Date: Thu, 9 May 2019 21:14:09 +0200 Subject: [PATCH 11/12] Commented why we uninstall miniconda's numpy --- scripts/install_miniconda.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install_miniconda.sh b/scripts/install_miniconda.sh index 72c6d7245d..b4035f4528 100755 --- a/scripts/install_miniconda.sh +++ b/scripts/install_miniconda.sh @@ -46,4 +46,5 @@ fi export PATH="$INSTALL_FOLDER/bin:$PATH" echo "Adding $INSTALL_FOLDER to PATH. Consider adding it in your .rc file as well." conda update -q -y conda +# Uninstalling miniconda's numpy to avoid conflicting versions when creating the test env pip uninstall -y numpy From 8db4277d9669722cfc19247959f3fff73c459dee Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Fri, 10 May 2019 13:56:28 +0200 Subject: [PATCH 12/12] Added python_requires to setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index f6bb2b2e38..014b9e39ea 100755 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ def get_version(): package_data={'docs': ['*']}, include_package_data=True, classifiers=classifiers, + python_requires=">=3.5.4", install_requires=install_reqs, extras_require={ "plots": ["arviz"],