Skip to content

Commit faa0600

Browse files
committed
Remove tests covered by Aesara
1 parent c5db0e5 commit faa0600

File tree

1 file changed

+0
-106
lines changed

1 file changed

+0
-106
lines changed

pymc3/tests/test_distributions_random.py

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@
4949
RealMatrix,
5050
Rplus,
5151
Rplusbig,
52-
Rplusdunif,
53-
Runif,
5452
Simplex,
55-
Unit,
5653
Vector,
5754
build_model,
5855
product,
@@ -977,13 +974,6 @@ def ref_rand(size, kappa, b, mu):
977974

978975
pymc3_random(pm.AsymmetricLaplace, {"b": Rplus, "kappa": Rplus, "mu": R}, ref_rand=ref_rand)
979976

980-
@pytest.mark.skip(reason="This test is covered by Aesara")
981-
def test_lognormal(self):
982-
def ref_rand(size, mu, tau):
983-
return np.exp(mu + (tau ** -0.5) * st.norm.rvs(loc=0.0, scale=1.0, size=size))
984-
985-
pymc3_random(pm.Lognormal, {"mu": R, "tau": Rplusbig}, ref_rand=ref_rand)
986-
987977
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
988978
def test_student_t(self):
989979
def ref_rand(size, nu, mu, lam):
@@ -998,24 +988,6 @@ def ref_rand(size, mu, sigma, nu):
998988

999989
pymc3_random(pm.ExGaussian, {"mu": R, "sigma": Rplus, "nu": Rplus}, ref_rand=ref_rand)
1000990

1001-
@pytest.mark.skip(reason="This test is covered by Aesara")
1002-
def test_vonmises(self):
1003-
def ref_rand(size, mu, kappa):
1004-
x = st.vonmises.rvs(size=size, loc=mu, kappa=kappa)
1005-
1006-
pymc3_random(pm.VonMises, {"mu": R, "kappa": Rplus}, ref_rand=ref_rand)
1007-
1008-
@pytest.mark.skip(reason="This test is covered by Aesara")
1009-
def test_triangular(self):
1010-
def ref_rand(size, lower, upper, c):
1011-
scale = upper - lower
1012-
c_ = (c - lower) / scale
1013-
return st.triang.rvs(size=size, loc=lower, scale=scale, c=c_)
1014-
1015-
pymc3_random(
1016-
pm.Triangular, {"lower": Runif, "upper": Runif + 3, "c": Runif + 1}, ref_rand=ref_rand
1017-
)
1018-
1019991
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
1020992
def test_flat(self):
1021993
with pm.Model():
@@ -1043,50 +1015,6 @@ def test_beta_binomial(self):
10431015
def _beta_bin(self, n, alpha, beta, size=None):
10441016
return st.binom.rvs(n, st.beta.rvs(a=alpha, b=beta, size=size))
10451017

1046-
@pytest.mark.skip(reason="This test is covered by Aesara")
1047-
def test_bernoulli(self):
1048-
pymc3_random_discrete(
1049-
pm.Bernoulli, {"p": Unit}, ref_rand=lambda size, p=None: st.bernoulli.rvs(p, size=size)
1050-
)
1051-
1052-
@pytest.mark.skip(reason="This test is covered by Aesara")
1053-
def test_poisson(self):
1054-
pymc3_random_discrete(pm.Poisson, {"mu": Rplusbig}, size=500, ref_rand=st.poisson.rvs)
1055-
1056-
@pytest.mark.skip(reason="This test is covered by Aesara")
1057-
def test_negative_binomial(self):
1058-
def ref_rand(size, alpha, mu):
1059-
return st.nbinom.rvs(alpha, alpha / (mu + alpha), size=size)
1060-
1061-
pymc3_random_discrete(
1062-
pm.NegativeBinomial,
1063-
{"mu": Rplusbig, "alpha": Rplusbig},
1064-
size=100,
1065-
fails=50,
1066-
ref_rand=ref_rand,
1067-
)
1068-
1069-
@pytest.mark.skip(reason="This test is covered by Aesara")
1070-
def test_geometric(self):
1071-
pymc3_random_discrete(pm.Geometric, {"p": Unit}, size=500, fails=50, ref_rand=nr.geometric)
1072-
1073-
@pytest.mark.skip(reason="This test is covered by Aesara")
1074-
def test_hypergeometric(self):
1075-
def ref_rand(size, N, k, n):
1076-
return st.hypergeom.rvs(M=N, n=k, N=n, size=size)
1077-
1078-
pymc3_random_discrete(
1079-
pm.HyperGeometric,
1080-
{
1081-
"N": Domain([10, 11, 12, 13], "int64"),
1082-
"k": Domain([4, 5, 6, 7], "int64"),
1083-
"n": Domain([6, 7, 8, 9], "int64"),
1084-
},
1085-
size=500,
1086-
fails=50,
1087-
ref_rand=ref_rand,
1088-
)
1089-
10901018
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
10911019
def test_discrete_uniform(self):
10921020
def ref_rand(size, lower, upper):
@@ -1096,33 +1024,6 @@ def ref_rand(size, lower, upper):
10961024
pm.DiscreteUniform, {"lower": -NatSmall, "upper": NatSmall}, ref_rand=ref_rand
10971025
)
10981026

1099-
@pytest.mark.skip(reason="This test is covered by Aesara")
1100-
def test_discrete_weibull(self):
1101-
def ref_rand(size, q, beta):
1102-
u = np.random.uniform(size=size)
1103-
1104-
return np.ceil(np.power(np.log(1 - u) / np.log(q), 1.0 / beta)) - 1
1105-
1106-
pymc3_random_discrete(
1107-
pm.DiscreteWeibull, {"q": Unit, "beta": Rplusdunif}, ref_rand=ref_rand
1108-
)
1109-
1110-
@pytest.mark.skip(reason="This test is covered by Aesara")
1111-
def test_weibull(self):
1112-
def ref_rand(size, alpha, beta):
1113-
u = np.random.uniform(size=size)
1114-
return beta * np.power(-np.log(u), 1 / alpha)
1115-
1116-
pymc3_random(pm.Weibull, {"alpha": Rplusbig, "beta": Rplusbig}, ref_rand=ref_rand)
1117-
1118-
@pytest.mark.skip(reason="This test is covered by Aesara")
1119-
@pytest.mark.parametrize("s", [2, 3, 4])
1120-
def test_categorical_random(self, s):
1121-
def ref_rand(size, p):
1122-
return nr.choice(np.arange(p.shape[0]), p=p, size=size)
1123-
1124-
pymc3_random_discrete(pm.Categorical, {"p": Simplex(s)}, ref_rand=ref_rand)
1125-
11261027
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
11271028
def test_constant_dist(self):
11281029
def ref_rand(size, c):
@@ -1339,13 +1240,6 @@ def test_dirichlet_multinomial_dist_ShapeError(self, n, a, shape, expectation):
13391240
with expectation:
13401241
m.random()
13411242

1342-
@pytest.mark.skip(reason="This test is covered by Aesara")
1343-
def test_logistic(self):
1344-
def ref_rand(size, mu, s):
1345-
return st.logistic.rvs(loc=mu, scale=s, size=size)
1346-
1347-
pymc3_random(pm.Logistic, {"mu": R, "s": Rplus}, ref_rand=ref_rand)
1348-
13491243
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
13501244
def test_logitnormal(self):
13511245
def ref_rand(size, mu, sigma):

0 commit comments

Comments
 (0)