Skip to content

Commit

Permalink
Change check_selfconsistency_discrete_logcdf to work with negative …
Browse files Browse the repository at this point in the history
…domains, such as the DiscreteUniform.
  • Loading branch information
ricardoV94 committed Dec 29, 2020
1 parent 2c3c2a0 commit 670a652
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pymc3/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def check_selfconsistency_discrete_logcdf(
for pt in product(domains, n_samples=n_samples):
params = dict(pt)
value = params.pop("value")
values = np.arange(0, value + 1)
values = np.arange(domain.lower, value + 1)
dist = distribution.dist(**params)
assert_almost_equal(
dist.logcdf(value).tag.test_value,
Expand Down Expand Up @@ -673,8 +673,7 @@ def test_discrete_unif(self):
self.check_selfconsistency_discrete_logcdf(
DiscreteUniform,
Rdunif,
# Using lower = Bool, as this unittest assumes the distribution domain starts at zero.
{"lower": Bool, "upper": Rplusdunif},
{"lower": -Rplusdunif, "upper": Rplusdunif},
)

def test_flat(self):
Expand Down

0 comments on commit 670a652

Please sign in to comment.