Skip to content

Commit 2c3ba51

Browse files
jessegrabowskiricardoV94
authored andcommitted
Ignore numpy warnings in TestSkellam
1 parent 9fcd850 commit 2c3ba51

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pymc_experimental/tests/distributions/test_discrete.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ class TestSkellam:
199199
def test_logp(self):
200200
# Scipy Skellam underflows to -inf earlier than PyMC
201201
Rplus_small = Domain([0, 0.01, 0.1, 0.9, 0.99, 1, 1.5, 2, 10, np.inf])
202-
check_logp(
203-
Skellam,
204-
I,
205-
{"mu1": Rplus_small, "mu2": Rplus_small},
206-
lambda value, mu1, mu2: scipy.stats.skellam.logpmf(value, mu1, mu2),
207-
)
202+
# Suppress warnings coming from Scipy logpmf implementation
203+
with np.errstate(divide="ignore", invalid="ignore"):
204+
check_logp(
205+
Skellam,
206+
I,
207+
{"mu1": Rplus_small, "mu2": Rplus_small},
208+
lambda value, mu1, mu2: scipy.stats.skellam.logpmf(value, mu1, mu2),
209+
)

0 commit comments

Comments
 (0)