Skip to content

Commit 670a652

Browse files
committed
Change check_selfconsistency_discrete_logcdf to work with negative domains, such as the DiscreteUniform.
1 parent 2c3c2a0 commit 670a652

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pymc3/tests/test_distributions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def check_selfconsistency_discrete_logcdf(
588588
for pt in product(domains, n_samples=n_samples):
589589
params = dict(pt)
590590
value = params.pop("value")
591-
values = np.arange(0, value + 1)
591+
values = np.arange(domain.lower, value + 1)
592592
dist = distribution.dist(**params)
593593
assert_almost_equal(
594594
dist.logcdf(value).tag.test_value,
@@ -673,8 +673,7 @@ def test_discrete_unif(self):
673673
self.check_selfconsistency_discrete_logcdf(
674674
DiscreteUniform,
675675
Rdunif,
676-
# Using lower = Bool, as this unittest assumes the distribution domain starts at zero.
677-
{"lower": Bool, "upper": Rplusdunif},
676+
{"lower": -Rplusdunif, "upper": Rplusdunif},
678677
)
679678

680679
def test_flat(self):

0 commit comments

Comments
 (0)