Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Aug 6, 2024
1 parent 3302ff0 commit f32dd31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_binom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from numba_stats import binom
import scipy.stats as sc
import pytest
import numba as nb


# NC and KC are all combinations of n and k from 0 to 10
Expand All @@ -18,7 +19,6 @@

@pytest.mark.parametrize("p", np.linspace(0, 1, 5))
def test_pmf(p):
print(KC, NC)
got = binom.pmf(KC, NC, p)
expected = sc.binom.pmf(KC, NC, p)
np.testing.assert_allclose(got, expected)
Expand All @@ -31,11 +31,12 @@ def test_cdf(p):
np.testing.assert_allclose(got, expected)


@pytest.mark.parametrize("n", np.linspace(0, 10, 6))
@pytest.mark.parametrize("n", np.arange(0, 10))
@pytest.mark.parametrize("p", np.linspace(0, 1, 5))
def test_rvs(n, p):
got = binom.rvs(n, p, size=1000, random_state=1)

@nb.njit
def expected():
np.random.seed(1)
return np.random.binomial(n, p, 1000)
Expand Down

0 comments on commit f32dd31

Please sign in to comment.