Esempio n. 1
0
def test_simpleflie():
    data = []
    proj = model.Projection
    for i in range(10, 301, 10):
        data.append(round_signif(proj(i).pv_NetLiabilityCashflow(0), 10))

    with open(testdata, 'rb') as file:
        data_saved = pickle.load(file)

    assert data == data_saved
def get_nested(outer, item):

    cells = outer.cells[item]

    act = [cells[t] for t in range(50)]
    expect = []

    for t0 in range(0, 6):
        expect_t0 = [np.nan] * 50
        for t in range(0, 50):
            if t < t0:
                expect_t0[t] = 0
            else:
                cells = outer.InnerProjection[t0].cells[item]
                expect_t0[t] = cells[t]

        expect.append(expect_t0)

    act = [round_signif(val, 10) for val in act]
    expect = [[round_signif(val, 10) for val in inner] for inner in expect]

    return [act, expect]