Exemplo n.º 1
0
def test_difference_table(cps_subsample):
    pol = Policy()
    recs = Records.cps_constructor(data=cps_subsample)
    calc1 = Calculator(policy=pol, records=recs)
    assert calc1.current_year == 2014
    reform = {2014: {'_SS_Earnings_c': [9e99]}}
    pol.implement_reform(reform)
    assert not pol.reform_errors
    calc2 = Calculator(policy=pol, records=recs)
    calc2.calc_all()
    diff = calc1.difference_table(calc2)
    assert isinstance(diff, pd.DataFrame)
Exemplo n.º 2
0
def test_difference_table(cps_subsample):
    cyr = 2014
    pol = Policy()
    recs = Records.cps_constructor(data=cps_subsample)
    calc1 = Calculator(policy=pol, records=recs)
    assert calc1.current_year == cyr
    reform = {cyr: {'_SS_Earnings_c': [9e99]}}
    pol.implement_reform(reform)
    calc2 = Calculator(policy=pol, records=recs)
    assert calc2.current_year == cyr
    calc1.calc_all()
    calc2.calc_all()
    diff = calc1.difference_table(calc2, 'weighted_deciles', 'iitax')
    assert isinstance(diff, pd.DataFrame)
Exemplo n.º 3
0
def test_difference_table(cps_subsample):
    """
    Test difference_table method.
    """
    cyr = 2014
    pol = Policy()
    recs = Records.cps_constructor(data=cps_subsample)
    calc1 = Calculator(policy=pol, records=recs)
    assert calc1.current_year == cyr
    reform = {cyr: {'_SS_Earnings_c': [9e99]}}
    pol.implement_reform(reform)
    calc2 = Calculator(policy=pol, records=recs)
    assert calc2.current_year == cyr
    calc1.calc_all()
    calc2.calc_all()
    diff = calc1.difference_table(calc2, 'weighted_deciles', 'iitax')
    assert isinstance(diff, pd.DataFrame)