本文整理汇总了Python中taxcalc.Policy.default_data方法的典型用法代码示例。如果您正苦于以下问题:Python Policy.default_data方法的具体用法?Python Policy.default_data怎么用?Python Policy.default_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taxcalc.Policy
的用法示例。
在下文中一共展示了Policy.default_data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parameters_get_default_start_year
# 需要导入模块: from taxcalc import Policy [as 别名]
# 或者: from taxcalc.Policy import default_data [as 别名]
def test_parameters_get_default_start_year():
paramdata = Policy.default_data(metadata=True, start_year=2015)
# 1D data, has 2015 values
meta_II_em = paramdata['_II_em']
assert meta_II_em['start_year'] == 2015
assert meta_II_em['row_label'] == ['2015', '2016']
assert meta_II_em['value'] == [4000, 4050]
# 2D data, has 2015 values
meta_std_aged = paramdata['_STD_Aged']
assert meta_std_aged['start_year'] == 2015
assert meta_std_aged['row_label'] == ['2015', '2016']
assert meta_std_aged['value'] == [[1550, 1250, 1250, 1550, 1550, 1250],
[1550, 1250, 1250, 1550, 1550, 1250]]
# 1D data, doesn't have 2015 values, is CPI inflated
meta_amt_thd_marrieds = paramdata['_AMT_thd_MarriedS']
assert meta_amt_thd_marrieds['start_year'] == 2015
assert meta_amt_thd_marrieds['row_label'] == ['2015']
# Take the 2014 parameter value and multiply by inflation for that year
should_be = 41050 * (1.0 + Policy.default_inflation_rates()[2014])
meta_amt_thd_marrieds['value'] == should_be
# 1D data, doesn't have 2015 values, is not CPI inflated
meta_kt_c_age = paramdata['_KT_c_Age']
assert meta_kt_c_age['start_year'] == 2015
assert meta_kt_c_age['row_label'] == ['2015']
assert meta_kt_c_age['value'] == [24]
示例2: test_parameters_get_default
# 需要导入模块: from taxcalc import Policy [as 别名]
# 或者: from taxcalc.Policy import default_data [as 别名]
def test_parameters_get_default():
paramdata = Policy.default_data()
assert paramdata['_CDCC_ps'] == [15000]