Skip to content

Commit

Permalink
Merge pull request PSLmodels#1813 from martinholmer/ubi-names
Browse files Browse the repository at this point in the history
Revise three UBI policy parameter names
  • Loading branch information
martinholmer authored Jan 11, 2018
2 parents c18f61f + 899f399 commit 9cef508
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ for a complete commit history.
- Make objects embedded in a Calculator object private and provide Calculator class access methods to manipulate the embedded objects
[[#1791](https://github.com/open-source-economics/Tax-Calculator/pull/1791)
by Martin Holmer]
- Rename three UBI policy parameters to be more descriptive
[[#1813](https://github.com/open-source-economics/Tax-Calculator/pull/1813)
by Martin Holmer as suggested by Max Ghenis]

**New Features**
- Add `--outdir` option to command-line `tc` tool
Expand Down
6 changes: 3 additions & 3 deletions taxcalc/current_law_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5784,7 +5784,7 @@
"out_of_range_action": "stop"
},

"_UBI1": {
"_UBI_u18": {
"long_name": "UBI benefit for those under 18",
"description": "UBI benefit provided to people under 18.",
"section_1": "Universal Basic Income",
Expand Down Expand Up @@ -5814,7 +5814,7 @@
"out_of_range_action": "stop"
},

"_UBI2": {
"_UBI_1820": {
"long_name": "UBI benefit for those 18 through 20",
"description": "UBI benefit provided to people 18-20 years of age.",
"section_1": "Universal Basic Income",
Expand Down Expand Up @@ -5844,7 +5844,7 @@
"out_of_range_action": "stop"
},

"_UBI3": {
"_UBI_21": {
"long_name": "UBI benefit for those 21 and over",
"description": "UBI benefit provided to people 21 and over.",
"section_1": "Universal Basic Income",
Expand Down
10 changes: 5 additions & 5 deletions taxcalc/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def SSBenefits(MARS, ymod, e02400, SS_thd50, SS_thd85,


@iterate_jit(nopython=True)
def UBI(nu18, n1821, n21, UBI1, UBI2, UBI3, UBI_ecrt,
def UBI(nu18, n1821, n21, UBI_u18, UBI_1820, UBI_21, UBI_ecrt,
ubi, taxable_ubi, nontaxable_ubi):
"""
Expand All @@ -303,9 +303,9 @@ def UBI(nu18, n1821, n21, UBI1, UBI2, UBI3, UBI_ecrt,
nu18: Number of people in the tax unit under 18
n1821: Number of people in the tax unit age 18-20
n21: Number of people in the tax unit age 21+
UBI1: UBI for those under 18
UBI2: UBI for those between 18 to 20
UBI3: UBI for those 21 or more
UBI_u18: UBI benefit for those under 18
UBI_1820: UBI benefit for those between 18 to 20
UBI_21: UBI benefit for those 21 or more
UBI_ecrt: Fraction of UBI benefits that are not included in AGI
Returns
Expand All @@ -316,7 +316,7 @@ def UBI(nu18, n1821, n21, UBI1, UBI2, UBI3, UBI_ecrt,
This is added to expanded income
"""
ubi = nu18 * UBI1 + n1821 * UBI2 + n21 * UBI3
ubi = nu18 * UBI_u18 + n1821 * UBI_1820 + n21 * UBI_21
taxable_ubi = ubi * (1. - UBI_ecrt)
nontaxable_ubi = ubi - taxable_ubi
return ubi, taxable_ubi, nontaxable_ubi
Expand Down
4 changes: 3 additions & 1 deletion taxcalc/tests/test_calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,9 @@ def test_distribution_tables(cps_subsample):
dt1, dt2 = calc1.distribution_tables(calc1)
assert isinstance(dt1, pd.DataFrame)
assert isinstance(dt2, pd.DataFrame)
reform = {2014: {'_UBI1': [1000], '_UBI2': [1000], '_UBI3': [1000]}}
reform = {2014: {'_UBI_u18': [1000],
'_UBI_1820': [1000],
'_UBI_21': [1000]}}
pol.implement_reform(reform)
assert not pol.reform_errors
calc2 = Calculator(policy=pol, records=recs)
Expand Down

0 comments on commit 9cef508

Please sign in to comment.