def test_LeastSquares_mask(): c = LeastSquares([1, 2, 3], [3, np.nan, 4], [1, 1, 1], lambda x, a: x + a) assert c.ndata == 3 assert np.isnan(c(0)) == True m = Minuit(c, 1) assert m.ndof == 2 m.migrad() assert not m.valid c.mask = np.arange(3) != 1 assert np.isnan(c(0)) == False assert c.ndata == 2 assert m.ndof == 1 m.migrad() assert m.valid assert_equal(m.values, [1.5])
def test_LeastSquares_mask(): c = LeastSquares([1, 2, 3], [3, np.nan, 4], [1, 1, 1], lambda x, a: x + a) assert np.isnan(c(0)) == True c.mask = np.arange(3) != 1 assert np.isnan(c(0)) == False