Beispiel #1
0
def test_BinnedNLL_mask():

    c = BinnedNLL([5, 1000, 1], [0, 1, 2, 3], expon_cdf)

    c_unmasked = c(1)
    c.mask = np.arange(3) != 1
    assert c(1) < c_unmasked
Beispiel #2
0
def test_BinnedNLL_mask():
    c = BinnedNLL([1, 1000, 2], [0, 1, 2, 3], lambda x, a: x + a)

    assert c(2) == pytest.approx(-7000, rel=0.1)
    c.mask = np.arange(3) != 1
    assert c(2) == pytest.approx(-3, rel=0.1)