Beispiel #1
0
def test_sampler_errors():
    pf = ParticleFilter(func, 100, boundaries=np.array([[0, 1], [0, 1]]))
    with pytest.raises(TypeError):
        pf.sample_seed(10, "uniform_sampler")
    with pytest.raises(ValueError):
        pf.sample_seed(10, callback)
Beispiel #2
0
def test_sampler():
    pf = ParticleFilter(func, 100, boundaries=np.array([[0, 1], [0, 1]]))
    pf.validate_emptiness()
    pf.sample_seed(10, uniform_sampler)
    with pytest.raises(Exception):
        pf.validate_emptiness()