def test_build_from_info(): """we can rebuild terms from info """ terms = [Intercept(), LinearTerm(0), SplineTerm(0), FactorTerm(0), TensorTerm(0,1)] for term in terms: assert Term.build_from_info(term.info) == term assert te(0, 1) == TensorTerm(SplineTerm(0, n_splines=10), SplineTerm(1, n_splines=10))
def test_term_list_from_info(): """we can remake a term list from info """ term_list = SplineTerm(0) + LinearTerm(1) assert Term.build_from_info(term_list.info) == term_list