|
29 | 29 |
|
30 | 30 | import pymc as pm
|
31 | 31 |
|
| 32 | +from pymc import ImputationWarning |
32 | 33 | from pymc.distributions.discrete import OrderedLogistic, OrderedProbit
|
33 | 34 | from pymc.logprob.basic import icdf, logcdf, logp
|
34 | 35 | from pymc.logprob.utils import ParameterValueError
|
@@ -877,7 +878,10 @@ def test_compute_p(self):
|
877 | 878 |
|
878 | 879 | # Test it works with auto-imputation
|
879 | 880 | with pm.Model() as m:
|
880 |
| - pm.OrderedLogistic("ol", cutpoints=np.array([-2, 0, 2]), eta=0, observed=[0, np.nan, 1]) |
| 881 | + with pytest.warns(ImputationWarning): |
| 882 | + pm.OrderedLogistic( |
| 883 | + "ol", cutpoints=np.array([-2, 0, 2]), eta=0, observed=[0, np.nan, 1] |
| 884 | + ) |
881 | 885 | assert len(m.deterministics) == 2 # One from the auto-imputation, the other from compute_p
|
882 | 886 |
|
883 | 887 |
|
@@ -925,7 +929,8 @@ def test_compute_p(self):
|
925 | 929 |
|
926 | 930 | # Test it works with auto-imputation
|
927 | 931 | with pm.Model() as m:
|
928 |
| - pm.OrderedProbit( |
929 |
| - "op", cutpoints=np.array([-2, 0, 2]), eta=0, sigma=1, observed=[0, np.nan, 1] |
930 |
| - ) |
| 932 | + with pytest.warns(ImputationWarning): |
| 933 | + pm.OrderedProbit( |
| 934 | + "op", cutpoints=np.array([-2, 0, 2]), eta=0, sigma=1, observed=[0, np.nan, 1] |
| 935 | + ) |
931 | 936 | assert len(m.deterministics) == 2 # One from the auto-imputation, the other from compute_p
|
0 commit comments