Skip to content

Commit f6f0a68

Browse files
Attempt to split tests for normal into smaller tests
1 parent 9640607 commit f6f0a68

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mkl_random/tests/test_random.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,21 +788,25 @@ def test_randomdist_noncentral_f(randomdist):
788788
np.testing.assert_allclose(actual, desired, atol=1e-7, rtol=1e-10)
789789

790790

791-
def test_randomdist_normal(randomdist):
791+
def test_randomdist_normal_case1(randomdist):
792792
rnd.seed(randomdist.seed, brng=randomdist.brng)
793793
actual = rnd.normal(loc=.123456789, scale=2.0, size=(3, 2))
794794
desired = np.array([[4.405778774782659, -4.020116569348963],
795795
[-1.732103577371005, 1.2282652034983546],
796796
[0.21648943171034918, 4.625591634211608]])
797797
np.testing.assert_allclose(actual, desired, atol=1e-7, rtol=1e-10)
798798

799+
800+
def test_randomdist_normal_case2(randomdist):
799801
rnd.seed(randomdist.seed, brng=randomdist.brng)
800802
actual = rnd.normal(loc=.123456789, scale=2.0, size=(3, 2), method="BoxMuller")
801803
desired = np.array([[0.16673479781277187, -3.4809986872165952],
802804
[-0.05193761082535492, 3.249201213154922],
803805
[-0.11915582299214138, 3.555636100927892]])
804806
np.testing.assert_allclose(actual, desired, atol=1e-8, rtol=1e-8)
805807

808+
809+
def test_randomdist_normal_case3(randomdist):
806810
rnd.seed(randomdist.seed, brng=randomdist.brng)
807811
actual = rnd.normal(loc=.123456789, scale=2.0, size=(3, 2), method="BoxMuller2")
808812
desired = np.array([[0.16673479781277187, 0.48153966449249175],
@@ -893,14 +897,16 @@ def test_randomdist_standard_gamma(randomdist):
893897
np.testing.assert_allclose(actual, desired, atol=1e-7, rtol=1e-10)
894898

895899

896-
def test_randomdist_standard_normal(randomdist):
900+
def test_randomdist_standard_normal_case1(randomdist):
897901
rnd.seed(randomdist.seed, brng=randomdist.brng)
898902
actual = rnd.standard_normal(size=(3, 2))
899903
desired = np.array([[2.1411609928913298, -2.071786679174482],
900904
[-0.9277801831855025, 0.5524042072491773],
901905
[0.04651632135517459, 2.2510674226058036]])
902906
np.testing.assert_allclose(actual, desired, atol=1e-7, rtol=1e-10)
903907

908+
909+
def test_randomdist_standard_normal_case2(randomdist):
904910
rnd.seed(randomdist.seed, brng=randomdist.brng)
905911
actual = rnd.standard_normal(size=(3, 2), method='BoxMuller2')
906912
desired = np.array([[0.021639004406385935, 0.17904143774624587],

0 commit comments

Comments
 (0)