Skip to content

Commit

Permalink
Remove stale/redundant random tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Dec 8, 2021
1 parent 1b5e2a9 commit 7191e61
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
35 changes: 0 additions & 35 deletions pymc/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2134,14 +2134,6 @@ def test_dirichlet_vectorized(self, a, size):
err_msg=f"vals={vals}",
)

def test_dirichlet_shape(self):
a = at.as_tensor_variable(np.r_[1, 2])
dir_rv = Dirichlet.dist(a)
assert dir_rv.shape.eval() == (2,)

with pytest.warns(DeprecationWarning), aesara.change_flags(compute_test_value="ignore"):
dir_rv = Dirichlet.dist(at.vector())

@pytest.mark.parametrize("n", [2, 3])
def test_multinomial(self, n):
self.check_logp(
Expand All @@ -2151,33 +2143,6 @@ def test_multinomial(self, n):
lambda value, n, p: scipy.stats.multinomial.logpmf(value, n, p),
)

@pytest.mark.parametrize(
"p, size, n",
[
[[0.25, 0.25, 0.25, 0.25], (4,), 2],
[[0.25, 0.25, 0.25, 0.25], (1, 4), 3],
# 3: expect to fail
# [[.25, .25, .25, .25], (10, 4)],
[[0.25, 0.25, 0.25, 0.25], (10, 1, 4), 5],
# 5: expect to fail
# [[[.25, .25, .25, .25]], (2, 4), [7, 11]],
[[[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]], (2, 4), 13],
[[[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]], (1, 2, 4), [23, 29]],
[
[[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]],
(10, 2, 4),
[31, 37],
],
[[[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]], (2, 4), [17, 19]],
],
)
def test_multinomial_random(self, p, size, n):
p = np.asarray(p)
with Model() as model:
m = Multinomial("m", n=n, p=p, size=size)

assert m.eval().shape == size + p.shape

@pytest.mark.parametrize("n", [(10), ([10, 11]), ([[5, 6], [10, 11]])])
@pytest.mark.parametrize(
"p",
Expand Down
12 changes: 0 additions & 12 deletions pymc/tests/test_distributions_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,6 @@ class TestGaussianRandomWalk(BaseTestCases.BaseTestCase):
default_shape = (1,)


@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
class TestZeroInflatedNegativeBinomial(BaseTestCases.BaseTestCase):
distribution = pm.ZeroInflatedNegativeBinomial
params = {"mu": 1.0, "alpha": 1.0, "psi": 0.3}


@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
class TestZeroInflatedBinomial(BaseTestCases.BaseTestCase):
distribution = pm.ZeroInflatedBinomial
params = {"n": 10, "p": 0.6, "psi": 0.3}


class BaseTestDistribution(SeededTest):
"""
This class provides a base for tests that new RandomVariables are correctly
Expand Down

0 comments on commit 7191e61

Please sign in to comment.