diff --git a/.codecov.yml b/.codecov.yml index e7fe4624f7..6b3f1f0830 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,7 @@ codecov: require_ci_to_pass: no notify: - after_n_builds: 9 + after_n_builds: 16 coverage: precision: 2 diff --git a/.github/workflows/arviz_compat.yml b/.github/workflows/arviz_compat.yml index 34b4106f00..2bbf076205 100644 --- a/.github/workflows/arviz_compat.yml +++ b/.github/workflows/arviz_compat.yml @@ -12,6 +12,7 @@ jobs: os: [ubuntu-latest, macos-latest] floatx: [float64] test-subset: + - pymc3/tests/test_distributions.py - pymc3/tests/test_distributions_random.py - pymc3/tests/test_sampling.py fail-fast: false @@ -27,12 +28,12 @@ jobs: - name: Cache conda uses: actions/cache@v1 env: - # Increase this value to reset cache if environment-dev-py38.yml has not changed + # Increase this value to reset cache if environment-dev-py39.yml has not changed CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('conda-envs/environment-dev-py38.yml') }} + hashFiles('conda-envs/environment-dev-py39.yml') }} - name: Cache multiple paths uses: actions/cache@v2 env: @@ -47,18 +48,18 @@ jobs: hashFiles('requirements.txt') }} - uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: pymc3-dev-py38 + activate-environment: pymc3-dev-py39 channel-priority: strict - environment-file: conda-envs/environment-dev-py38.yml + environment-file: conda-envs/environment-dev-py39.yml use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Install pymc3 run: | - conda activate pymc3-dev-py38 + conda activate pymc3-dev-py39 pip install -e . python --version - name: Install latest arviz run: | - conda activate pymc3-dev-py38 + conda activate pymc3-dev-py39 pip uninstall arviz -y pip install git+git://github.com/arviz-devs/arviz.git - name: Run tests diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a4f7eced28..1b33e899d3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -70,12 +70,12 @@ jobs: - name: Cache conda uses: actions/cache@v1 env: - # Increase this value to reset cache if environment-dev-py39.yml has not changed + # Increase this value to reset cache if environment-dev-py37.yml has not changed CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('conda-envs/environment-dev-py39.yml') }} + hashFiles('conda-envs/environment-dev-py37.yml') }} - name: Cache multiple paths uses: actions/cache@v2 env: @@ -90,18 +90,18 @@ jobs: hashFiles('requirements.txt') }} - uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: pymc3-dev-py39 + activate-environment: pymc3-dev-py37 channel-priority: strict - environment-file: conda-envs/environment-dev-py39.yml + environment-file: conda-envs/environment-dev-py37.yml use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Install-pymc3 run: | - conda activate pymc3-dev-py39 + conda activate pymc3-dev-py37 pip install -e . python --version - name: Run tests run: | - conda activate pymc3-dev-py39 + conda activate pymc3-dev-py37 python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b5170fc876..8a81e97b21 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -26,12 +26,12 @@ jobs: - name: Cache conda uses: actions/cache@v1 env: - # Increase this value to reset cache if conda-envs/environment-dev-py37.yml has not changed + # Increase this value to reset cache if conda-envs/environment-dev-py38.yml has not changed CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('conda-envs/environment-dev-py37.yml') }} + hashFiles('conda-envs/environment-dev-py38.yml') }} - name: Cache multiple paths uses: actions/cache@v2 env: @@ -46,15 +46,15 @@ jobs: hashFiles('requirements.txt') }} - uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: pymc3-dev-py37 + activate-environment: pymc3-dev-py38 channel-priority: strict - environment-file: conda-envs/environment-dev-py37.yml + environment-file: conda-envs/environment-dev-py38.yml use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Install-pymc3 run: | - conda activate pymc3-dev-py37 + conda activate pymc3-dev-py38 pip install -e . python --version - run: | - conda activate pymc3-dev-py37 + conda activate pymc3-dev-py38 python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4b750894e..468fe167e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: - id: conda-env-sort additional_dependencies: [pyyaml] entry: python scripts/sort_conda_envs.py - files: ^conda-envs/ + files: ^conda-envs/environment-dev-py37\.yml$ language: python name: Sort dependencies in conda envs types: [yaml] diff --git a/conda-envs/environment-dev-py37.yml b/conda-envs/environment-dev-py37.yml index 1a307dfd0f..c944732928 100644 --- a/conda-envs/environment-dev-py37.yml +++ b/conda-envs/environment-dev-py37.yml @@ -8,13 +8,16 @@ dependencies: - libblas=*=*mkl - mkl-service - nbsphinx>=0.4 +- numpy=1.15 - numpydoc>=0.9 +- pandas=0.24 - pre-commit>=2.8.0 - pytest-cov>=2.5 - pytest>=3.0 - python-graphviz - python=3.7 - recommonmark>=0.4 +- scipy=1.2 - sphinx-autobuild>=0.7 - sphinx>=1.5 - watermark diff --git a/pymc3/tests/test_distributions.py b/pymc3/tests/test_distributions.py index a2d00a2d60..93c8ade89d 100644 --- a/pymc3/tests/test_distributions.py +++ b/pymc3/tests/test_distributions.py @@ -25,6 +25,8 @@ from numpy import array, exp, inf, log from numpy.testing import assert_allclose, assert_almost_equal, assert_equal +from packaging.version import parse +from scipy import __version__ as scipy_version from scipy import integrate from scipy.special import erf, logit @@ -97,6 +99,8 @@ from pymc3.theanof import floatX from pymc3.vartypes import continuous_types +SCIPY_VERSION = parse(scipy_version) + def get_lkj_cases(): """ @@ -1163,6 +1167,9 @@ def test_binomial(self): # Too lazy to propagate decimal parameter through the whole chain of deps @pytest.mark.xfail(condition=(theano.config.floatX == "float32"), reason="Fails on float32") + @pytest.mark.xfail( + condition=(SCIPY_VERSION < parse("1.4.0")), reason="betabinom is new in Scipy 1.4.0" + ) def test_beta_binomial(self): self.checkd( BetaBinomial, diff --git a/requirements.txt b/requirements.txt index 6435bed13e..e10227e817 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ arviz>=0.9.0 dill fastprogress>=0.2.0 -numpy>=1.13.0 -pandas>=0.18.0 +numpy>=1.15.0 +pandas>=0.24.0 patsy>=0.5.1 -scipy>=0.18.1 +scipy>=1.2.0 theano-pymc==1.0.14 typing-extensions>=3.7.4 diff --git a/setup.py b/setup.py index 114d774fdc..9b8091ba1b 100755 --- a/setup.py +++ b/setup.py @@ -85,5 +85,4 @@ def get_version(): python_requires=">=3.7", install_requires=install_reqs, tests_require=test_reqs, - test_suite="nose.collector", )