Skip to content

Commit 4f98dba

Browse files
committed
Mark xfail 32-bit for Gamma logcdf
1 parent 6a55485 commit 4f98dba

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

pymc3/tests/test_distributions.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ def check_logp(
580580
n_samples : Int
581581
Upper limit on the number of valid domain and value combinations that
582582
are compared between pymc3 and scipy methods. If n_samples is below the
583-
total number of combinations, a random subset is evaluated.
584-
Defaults to 100
583+
total number of combinations, a random subset is evaluated. Setting
584+
n_samples = -1, will return all possible combinations. Defaults to 100
585585
extra_args : Dictionary with extra arguments needed to build pymc3 model
586586
Dictionary is passed to helper function `build_model` from which
587587
the pymc3 distribution logp is calculated
@@ -657,8 +657,8 @@ def check_logcdf(
657657
n_samples : Int
658658
Upper limit on the number of valid domain and value combinations that
659659
are compared between pymc3 and scipy methods. If n_samples is below the
660-
total number of combinations, a random subset is evaluated.
661-
Defaults to 100
660+
total number of combinations, a random subset is evaluated. Setting
661+
n_samples = -1, will return all possible combinations. Defaults to 100
662662
skip_paramdomain_inside_edge_test : Bool
663663
Whether to run test 1., which checks that pymc3 and scipy distributions
664664
match for valid values and parameters inside the respective domain edges
@@ -1205,7 +1205,7 @@ def test_half_cauchy(self):
12051205
lambda value, beta: sp.halfcauchy.logcdf(value, scale=beta),
12061206
)
12071207

1208-
def test_gamma(self):
1208+
def test_gamma_logp(self):
12091209
self.check_logp(
12101210
Gamma,
12111211
Rplus,
@@ -1216,11 +1216,21 @@ def test_gamma(self):
12161216
def test_fun(value, mu, sigma):
12171217
return sp.gamma.logpdf(value, mu ** 2 / sigma ** 2, scale=1.0 / (mu / sigma ** 2))
12181218

1219-
self.check_logp(Gamma, Rplus, {"mu": Rplusbig, "sigma": Rplusbig}, test_fun)
1219+
self.check_logp(
1220+
Gamma,
1221+
Rplus,
1222+
{"mu": Rplusbig, "sigma": Rplusbig},
1223+
test_fun,
1224+
)
12201225

1226+
@pytest.mark.xfail(
1227+
condition=(theano.config.floatX == "float32"),
1228+
reason="Fails on float32 due to numerical issues",
1229+
)
1230+
def test_gamma_logcdf(self):
12211231
# pymc-devs/Theano-PyMC#224: skip_paramdomain_outside_edge_test has to be set
12221232
# True to avoid triggering a C-level assertion in the Theano GammaQ function
1223-
# in gamma.c file. Can be set back to False (defalut) once that issue is solved
1233+
# in gamma.c file. Can be set back to False (default) once that issue is solved
12241234
self.check_logcdf(
12251235
Gamma,
12261236
Rplus,
@@ -1242,7 +1252,7 @@ def test_inverse_gamma(self):
12421252
)
12431253
# pymc-devs/Theano-PyMC#224: skip_paramdomain_outside_edge_test has to be set
12441254
# True to avoid triggering a C-level assertion in the Theano GammaQ function
1245-
# in gamma.c file. Can be set back to False (defalut) once that issue is solved
1255+
# in gamma.c file. Can be set back to False (default) once that issue is solved
12461256
self.check_logcdf(
12471257
InverseGamma,
12481258
Rplus,

0 commit comments

Comments
 (0)