def test_FMin(): fm = Namespace( fval=1.23456e-10, edm=1.23456e-10, up=0.5, is_valid=True, has_valid_parameters=True, has_accurate_covar=True, has_posdef_covar=True, has_made_posdef_covar=False, hesse_failed=False, has_covariance=True, is_above_max_edm=False, has_reached_call_limit=False, has_parameters_at_limit=False, errordef=1, state=[], ) fmin = util.FMin(fm, 1, 2, 1, 0.1) with PrintAssert("<FMin ...>") as pr: fmin._repr_pretty_(pr, True) with PrintAssert(tx.fmin(fmin)) as pr: fmin._repr_pretty_(pr, False)
def test_Minuit(): m = Minuit(sphere_np, (0, 0)) with PrintAssert("<Minuit ...>") as pr: m._repr_pretty_(pr, True) with PrintAssert(tx.params(m.params)) as pr: m._repr_pretty_(pr, False) m.migrad() expected = (tx.fmin(m.fmin) + "\n" + tx.params(m.params) + "\n" + tx.matrix(m.covariance)) with PrintAssert(expected) as pr: m._repr_pretty_(pr, False) m.minos() expected = (tx.fmin(m.fmin) + "\n" + tx.params(m.params) + "\n" + tx.merrors(m.merrors) + "\n" + tx.matrix(m.covariance)) with PrintAssert(expected) as pr: m._repr_pretty_(pr, False)
def test_text_fmin_bad(fmin_bad): assert _repr_text.fmin(fmin_bad) == ref("fmin_bad")
def test_text_fmin_good(fmin_good): assert _repr_text.fmin(fmin_good) == ref("fmin_good")