Skip to content

Commit

Permalink
Merge pull request #1677 from martinholmer/fix-tbi-gdp
Browse files Browse the repository at this point in the history
Fix logic of the run_nth_year_gdp_elast_model function
  • Loading branch information
martinholmer authored Nov 18, 2017
2 parents a4e4b46 + bdd08c7 commit 4870ea4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
34 changes: 34 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@ Go [here](https://github.com/open-source-economics/Tax-Calculator/pulls?q=is%3Ap
for a complete commit history.


2017-11-17 Release 0.13.2
-------------------------
(last merged pull request is
[#1680](https://github.com/open-source-economics/Tax-Calculator/pull/1680))

**API Changes**
- None

**New Features**
- Add TCJA_House_Amended JSON policy reform file
[[#1664](https://github.com/open-source-economics/Tax-Calculator/pull/1664)
by Cody Kallen and Matt Jensen]
- Add `_cpi_offset` policy parameter that can be used to specify chained CPI indexing reforms
[[#1667](https://github.com/open-source-economics/Tax-Calculator/pull/1667)
by Martin Holmer]
- Add new policy parameter that changes the stacking order of child/dependent credits
[[#1676](https://github.com/open-source-economics/Tax-Calculator/pull/1676)
by Matt Jensen as suggested by Cody Kallen with need identified by Joint Economic Committee staff]
- Add to several TCJA reform files the provision for chained CPI indexing
[[#1680](https://github.com/open-source-economics/Tax-Calculator/pull/1680)
by Matt Jensen]

**Bug Fixes**
- Fix `_ACTC_ChildNum` policy parameter documentation and logic
[[#1666](https://github.com/open-source-economics/Tax-Calculator/pull/1666)
by Martin Holmer, reported by Ernie Tedeschi]
- Fix documentation for mis-named `n1821` input variable
[[#1672](https://github.com/open-source-economics/Tax-Calculator/pull/1672)
by Martin Holmer, reported by Max Ghenis]
- Fix logic of run_nth_year_gdp_elast_model function in the TaxBrainInterface
[[#1677](https://github.com/open-source-economics/Tax-Calculator/pull/1677)
by Martin Holmer, reported by Hank Doupe]


2017-11-10 Release 0.13.1
-------------------------
(last merged pull request is
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/tbi/tbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def run_nth_year_gdp_elast_model(year_n, start_year,

# calculate gdp_effect
fyear = check_years_return_first_year(year_n, start_year, use_puf_not_cps)
if (start_year + year_n) > fyear:
if year_n > 0 and (start_year + year_n) > fyear:
# create calc1 and calc2 calculated for year_n - 1
(calc1, calc2, _) = calculate((year_n - 1), start_year,
use_puf_not_cps,
Expand Down
14 changes: 13 additions & 1 deletion taxcalc/tests/test_tbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,19 @@ def test_run_gdp_elast_model_1(resdict):
def test_run_gdp_elast_model_2():
usermods = USER_MODS
usermods['behavior'] = dict()
res = run_nth_year_gdp_elast_model(0, 2014, # forces no automatic zero
res = run_nth_year_gdp_elast_model(0, 2014, # forces automatic zero
use_puf_not_cps=False,
use_full_sample=False,
user_mods=usermods,
gdp_elasticity=0.36,
return_dict=False)
assert res == 0.0


def test_run_gdp_qelast_model_3():
usermods = USER_MODS
usermods['behavior'] = dict()
res = run_nth_year_gdp_elast_model(0, 2017, # forces automatic zero
use_puf_not_cps=False,
use_full_sample=False,
user_mods=usermods,
Expand Down

0 comments on commit 4870ea4

Please sign in to comment.