def test_tc_cps(rebal_weights, panel, manual_tc_cps):
    cols = ['EEM', 'EFA', 'IEF', 'IWV', 'IYR', 'SHY']
    vw_tcosts = cp.tc_cps(weight_df = rebal_weights, 
                          share_panel = panel,
                          cps = 10.,
    )

    testing.assert_frame_equal(manual_tc_cps[cols], vw_tcosts)
def test_tc_cps(rebal_weights, panel, manual_tc_cps):
    cols = ['EEM', 'EFA', 'IEF', 'IWV', 'IYR', 'SHY']
    vw_tcosts = cp.tc_cps(weight_df = rebal_weights, 
                          share_panel = panel,
                          cps = 10.,
    )

    testing.assert_frame_equal(manual_tc_cps[cols], vw_tcosts)
def test_net_cps(rebal_weights, panel, manual_tc_cps, manual_index):
    index = test_pfp(panel, manual_index)
    index = index['Close']

    vw_tcosts = cp.tc_cps(weight_df = rebal_weights, 
                          share_panel = panel,
                          cps = 10.,
    )

    net_tcs = cp.net_tcs(tc_df = vw_tcosts, 
                         price_index = index
    )

    testing.assert_series_equal(manual_tc_cps['adj_index'],
                                net_tcs
    )
def test_net_cps(rebal_weights, panel, manual_tc_cps, manual_index):
    index = test_pfp(panel, manual_index)
    index = index['Close']

    vw_tcosts = cp.tc_cps(weight_df = rebal_weights, 
                          share_panel = panel,
                          cps = 10.,
    )

    net_tcs = cp.net_tcs(tc_df = vw_tcosts, 
                         price_index = index
    )

    testing.assert_series_equal(manual_tc_cps['adj_index'],
                                net_tcs
    )