From 9b311bf8b4d8fae93db2a085fb5be1e8c730c570 Mon Sep 17 00:00:00 2001 From: danhphan Date: Sun, 6 Feb 2022 09:05:40 +1100 Subject: [PATCH] add 2d cutpoints and positive sigma --- pymc/tests/test_distributions_random.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pymc/tests/test_distributions_random.py b/pymc/tests/test_distributions_random.py index 73adc47abb7..93c3943aa94 100644 --- a/pymc/tests/test_distributions_random.py +++ b/pymc/tests/test_distributions_random.py @@ -1694,7 +1694,9 @@ class TestOrderedLogistic(BaseTestDistributionRandom): (0, [-2.0, 0, 2.0], (4,)), ([-1], [-2.0, 0, 2.0], (1, 4)), ([1.0, -2.0], [-1.0, 0, 1.0], (2, 4)), - ([[1.0, -1.0, 0.0], [-1.0, 3.0, 5.0]], [-2.0, 0, 1.0], (2, 3, 4)), + (np.zeros((3, 2)), [-2.0, 0, 1.0], (3, 2, 4)), + (np.ones((5, 2)), [[-2.0, 0, 1.0], [-1.0, 0, 1.0]], (5, 2, 4)), + (np.ones((3, 5, 2)), [[-2.0, 0, 1.0], [-1.0, 0, 1.0]], (3, 5, 2, 4)), ], ) def test_shape_inputs(self, eta, cutpoints, expected): @@ -1722,16 +1724,12 @@ class TestOrderedProbit(BaseTestDistributionRandom): "eta, cutpoints, sigma, expected", [ (0, [-2.0, 0, 2.0], 1.0, (4,)), - ([-1], [-2.0, 0, 2.0], [2.0], (1, 4)), + ([-1], [-1.0, 0, 2.0], [2.0], (1, 4)), ([1.0, -2.0], [-1.0, 0, 1.0], 1.0, (2, 4)), - ([1.0, -2.0, 3.0], [-2.0, 0, 2.0], [-1.0, -2.0, 5.0], (3, 4)), - ([[1.0, -1.0, 0.0], [-1.0, 3.0, 5.0]], [-2.0, 0, 1.0], [-1.0, -2.0, 5.0], (2, 3, 4)), - ( - [[1.0, -2.0, 3.0], [1.0, 2.0, -4.0]], - [-2.0, 0, 1.0], - [[0.0, 2.0, -4.0], [-1.0, 1.0, 3.0]], - (2, 3, 4), - ), + ([1.0, -2.0, 3.0], [-1.0, 0, 2.0], np.ones((1, 3)), (1, 3, 4)), + (np.zeros((2, 3)), [-2.0, 0, 1.0], [1.0, 2.0, 5.0], (2, 3, 4)), + (np.ones((2, 3)), [-1.0, 0, 1.0], np.ones((2, 3)), (2, 3, 4)), + (np.zeros((5, 2)), [[-2, 0, 1], [-1, 0, 1]], np.ones((2, 5, 2)), (2, 5, 2, 4)), ], ) def test_shape_inputs(self, eta, cutpoints, sigma, expected):