Skip to content

Commit

Permalink
Update scipy dependency to >= 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Jul 12, 2021
1 parent c00e589 commit 7486bf7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## PyMC3 vNext (4.0.0)
### Breaking Changes
- ⚠ Theano-PyMC has been replaced with Aesara, so all external references to `theano`, `tt`, and `pymc3.theanof` need to be replaced with `aesara`, `at`, and `pymc3.aesaraf` (see [4471](https://github.com/pymc-devs/pymc3/pull/4471)).
- ⚠ PyMC3 now requires Scipy version `>= 1.4.1` (see [4736](https://github.com/pymc-devs/pymc3/pull/4857)).
- ArviZ `plots` and `stats` *wrappers* were removed. The functions are now just available by their original names (see [#4549](https://github.com/pymc-devs/pymc3/pull/4471) and `3.11.2` release notes).
- The GLM submodule has been removed, please use [Bambi](https://bambinos.github.io/bambi/) instead.
- The `Distribution` keyword argument `testval` has been deprecated in favor of `initval`.
Expand Down
16 changes: 1 addition & 15 deletions pymc3/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
from aesara.tensor.var import TensorVariable
from numpy import array, 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

Expand Down Expand Up @@ -110,8 +108,6 @@
from pymc3.tests.helpers import select_by_precision
from pymc3.vartypes import continuous_types

SCIPY_VERSION = parse(scipy_version)


def get_lkj_cases():
"""
Expand Down Expand Up @@ -1570,29 +1566,19 @@ def test_beta_binomial_distribution(self):
{"alpha": Rplus, "beta": Rplus, "n": NatSmall},
)

@pytest.mark.skipif(
condition=(SCIPY_VERSION < parse("1.4.0")), reason="betabinom is new in Scipy 1.4.0"
)
def test_beta_binomial_logp(self):
def test_beta_binomial(self):
self.check_logp(
BetaBinomial,
Nat,
{"alpha": Rplus, "beta": Rplus, "n": NatSmall},
lambda value, alpha, beta, n: sp.betabinom.logpmf(value, a=alpha, b=beta, n=n),
)

@pytest.mark.skipif(
condition=(SCIPY_VERSION < parse("1.4.0")), reason="betabinom is new in Scipy 1.4.0"
)
def test_beta_binomial_logcdf(self):
self.check_logcdf(
BetaBinomial,
Nat,
{"alpha": Rplus, "beta": Rplus, "n": NatSmall},
lambda value, alpha, beta, n: sp.betabinom.logcdf(value, a=alpha, b=beta, n=n),
)

def test_beta_binomial_selfconsistency(self):
self.check_selfconsistency_discrete_logcdf(
BetaBinomial,
Nat,
Expand Down
8 changes: 0 additions & 8 deletions pymc3/tests/test_distributions_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import scipy.stats as st

from numpy.testing import assert_almost_equal, assert_array_almost_equal
from packaging.version import parse
from scipy import __version__ as scipy_version
from scipy.special import expit

import pymc3 as pm
Expand All @@ -47,8 +45,6 @@
product,
)

SCIPY_VERSION = parse(scipy_version)


def pymc3_random(
dist,
Expand Down Expand Up @@ -1317,10 +1313,6 @@ def seeded_weibul_rng_fn(self):
]


@pytest.mark.skipif(
condition=(SCIPY_VERSION < parse("1.4.0")),
reason="betabinom is new in Scipy 1.4.0",
)
class TestBetaBinomial(BaseTestDistribution):
pymc_dist = pm.BetaBinomial
pymc_dist_params = {"alpha": 2.0, "beta": 1.0, "n": 5}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ fastprogress>=0.2.0
numpy>=1.15.0
pandas>=0.24.0
patsy>=0.5.1
scipy>=1.2.0
scipy>=1.4.1
typing-extensions>=3.7.4

0 comments on commit 7486bf7

Please sign in to comment.