示例#1
0
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)
示例#2
0
def _basic_piecewise():
    pf = PiecewiseFunction()
    for n in NODES:
        pf.insert(n)

    return pf
示例#3
0
def test_dictionary_roundtrip():
    pf = _basic_piecewise()
    d = pf.to_dict()

    _compare_piecewise(pf, PiecewiseFunction.from_dict(d))