def test_node_ordering(): pf = _basic_piecewise() reverse_pf = PiecewiseFunction() for n in reversed(NODES): reverse_pf.insert(n.copy()) _compare_piecewise(pf, reverse_pf)
def _basic_piecewise(): pf = PiecewiseFunction() for n in NODES: pf.insert(n) return pf
def test_dictionary_roundtrip(): pf = _basic_piecewise() d = pf.to_dict() _compare_piecewise(pf, PiecewiseFunction.from_dict(d))