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

    return pf
Exemplo n.º 3
0
def test_dictionary_roundtrip():
    pf = _basic_piecewise()
    d = pf.to_dict()

    _compare_piecewise(pf, PiecewiseFunction.from_dict(d))