Skip to content

Commit

Permalink
Remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-pallini committed Apr 5, 2021
1 parent f63e04a commit 598d0db
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions pymc3/tests/test_distributions_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from pymc3.distributions.multivariate import quaddist_matrix
from pymc3.distributions.shape_utils import to_tuple
from pymc3.exceptions import ShapeError
from pymc3.tests.helpers import SeededTest, select_by_precision
from pymc3.tests.helpers import SeededTest
from pymc3.tests.test_distributions import (
Domain,
I,
Expand Down Expand Up @@ -1772,36 +1772,3 @@ def test_with_cov_rv(self, sample_shape, dist_shape, mu_shape):
prior = pm.sample_prior_predictive(samples=sample_shape)

assert prior["mv"].shape == to_tuple(sample_shape) + dist_shape


def test_exponential_parameterization():
test_lambda = floatX(10.0)

exp_pymc = pm.Exponential.dist(lam=test_lambda)
(rv_scale,) = exp_pymc.owner.inputs[3:]

npt.assert_almost_equal(rv_scale.eval(), 1 / test_lambda)


def test_gamma_parameterization():

test_alpha = floatX(10.0)
test_beta = floatX(100.0)

gamma_pymc = pm.Gamma.dist(alpha=test_alpha, beta=test_beta)
rv_alpha, rv_inv_beta = gamma_pymc.owner.inputs[3:]

assert np.array_equal(rv_alpha.eval(), test_alpha)

decimal = select_by_precision(float64=6, float32=3)

npt.assert_almost_equal(rv_inv_beta.eval(), 1.0 / test_beta, decimal)

test_mu = test_alpha / test_beta
test_sigma = np.sqrt(test_mu / test_beta)

gamma_pymc = pm.Gamma.dist(mu=test_mu, sigma=test_sigma)
rv_alpha, rv_inv_beta = gamma_pymc.owner.inputs[3:]

npt.assert_almost_equal(rv_alpha.eval(), test_alpha, decimal)
npt.assert_almost_equal(rv_inv_beta.eval(), 1.0 / test_beta, decimal)

0 comments on commit 598d0db

Please sign in to comment.