def test_basic(self, dist, mv_ex): rng = SimpleRatioUniforms(dist, mode=dist.mode, random_state=42) check_cont_samples(rng, dist, mv_ex) rng = SimpleRatioUniforms(dist, mode=dist.mode, cdf_at_mode=dist.cdf(dist.mode), random_state=42) check_cont_samples(rng, dist, mv_ex)
def test_bad_args(self): # pdf_area < 0 with pytest.raises(ValueError, match=r"`pdf_area` must be > 0"): SimpleRatioUniforms(StandardNormal(), mode=0, pdf_area=-1)
def test_inf_nan_domains(self, domain, err, msg): with pytest.raises(err, match=msg): SimpleRatioUniforms(StandardNormal(), domain=domain)