当前位置: 首页>>代码示例>>Python>>正文


Python Records.set_current_year方法代码示例

本文整理汇总了Python中taxcalc.Records.set_current_year方法的典型用法代码示例。如果您正苦于以下问题:Python Records.set_current_year方法的具体用法?Python Records.set_current_year怎么用?Python Records.set_current_year使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在taxcalc.Records的用法示例。


在下文中一共展示了Records.set_current_year方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_correct_Records_instantiation

# 需要导入模块: from taxcalc import Records [as 别名]
# 或者: from taxcalc.Records import set_current_year [as 别名]
def test_correct_Records_instantiation():
    rec1 = Records(data=TAXDATA, blowup_factors=None, weights=WEIGHTS)
    assert rec1
    assert np.all(rec1.MARS != 0)
    assert rec1.current_year == Records.PUF_YEAR
    sum_e00200_in_puf_year = rec1.e00200.sum()
    rec1.set_current_year(Records.PUF_YEAR + 1)
    sum_e00200_in_puf_year_plus_one = rec1.e00200.sum()
    assert sum_e00200_in_puf_year_plus_one == sum_e00200_in_puf_year
    bf_df = pd.read_csv(Records.BLOWUP_FACTORS_PATH)
    rec2 = Records(data=TAXDATA, blowup_factors=bf_df, weights=None)
    assert rec2
    assert np.all(rec2.MARS != 0)
    assert rec2.current_year == Records.PUF_YEAR
开发者ID:akshaya-trivedi,项目名称:Tax-Calculator,代码行数:16,代码来源:test_records.py

示例2: test_correct_Records_instantiation_sample

# 需要导入模块: from taxcalc import Records [as 别名]
# 或者: from taxcalc.Records import set_current_year [as 别名]
def test_correct_Records_instantiation_sample(puf_1991, weights_1991):
    sample = puf_1991.sample(frac=0.10)
    rec1 = Records(data=sample, blowup_factors=None, weights=weights_1991)
    assert rec1
    assert np.all(rec1.MARS != 0)
    assert rec1.current_year == Records.PUF_YEAR
    sum_e00200_in_puf_year = rec1.e00200.sum()
    rec1.set_current_year(Records.PUF_YEAR + 1)
    sum_e00200_in_puf_year_plus_one = rec1.e00200.sum()
    assert sum_e00200_in_puf_year_plus_one == sum_e00200_in_puf_year
    bf_df = pd.read_csv(Records.BLOWUP_FACTORS_PATH)
    rec2 = Records(data=sample, blowup_factors=bf_df, weights=None)
    assert rec2
    assert np.all(rec2.MARS != 0)
    assert rec2.current_year == Records.PUF_YEAR
开发者ID:salimfurth,项目名称:Tax-Calculator,代码行数:17,代码来源:test_records.py

示例3: test_blowup

# 需要导入模块: from taxcalc import Records [as 别名]
# 或者: from taxcalc.Records import set_current_year [as 别名]
def test_blowup():
    pol1 = Policy()
    assert pol1.current_year == Policy.JSON_START_YEAR
    rec1 = Records(data=TAXDATA, weights=WEIGHTS)
    assert rec1.current_year == Records.PUF_YEAR
    calc1 = Calculator(policy=pol1, records=rec1, sync_years=True)
    assert calc1.records.current_year == Policy.JSON_START_YEAR
    pol2 = Policy()
    assert pol2.current_year == Policy.JSON_START_YEAR
    rec2 = Records(data=TAXDATA, weights=WEIGHTS)
    assert rec2.current_year == Records.PUF_YEAR
    rec2.set_current_year(Policy.JSON_START_YEAR)
    assert rec2.current_year == Policy.JSON_START_YEAR
    calc2 = Calculator(policy=pol2, records=rec2, sync_years=False)
    assert calc2.policy.current_year == Policy.JSON_START_YEAR
    assert calc2.records.current_year == Policy.JSON_START_YEAR
开发者ID:akshaya-trivedi,项目名称:Tax-Calculator,代码行数:18,代码来源:test_records.py


注:本文中的taxcalc.Records.set_current_year方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。