-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logic of the run_nth_year_gdp_elast_model function #1677
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1677 +/- ##
======================================
Coverage 100% 100%
======================================
Files 37 37
Lines 2856 2880 +24
======================================
+ Hits 2856 2880 +24
Continue to review full report at Codecov.
|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinholmer what condition are you checking here if (start_year + year_n) > fyear:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year_n can be zero even if (start_year + year_n) is greater than fyear,
which is equal to the value returned by this function:
def check_years_return_first_year(year_n, start_year, use_puf_not_cps):
"""
Ensure year_n and start_year values are valid given input data used.
Return value of first year, which is maximum of first records data year
and first policy parameter year.
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see. Thanks.
@martinholmer this looks good. Thanks for the quick turn around. |
RELEASES.md
Outdated
@@ -22,9 +22,6 @@ for a complete commit history. | |||
- 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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this read:
by Matt Jensen as suggested by Cody Kallen and with need identified by JEC staff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or better yet, 'Joint Economic Committee staff'
Thanks for the latest commit @martinholmer |
This pull request fixes a bug identified by @hdoupe in PolicyBrain 738.
This pull request adds a test to
test_tbi.py
that fails on the master branch (recreating the error reported by @hdoupe) and passes on this branch, which includes a one-line change to therun_nth_year_gdp_elast_model
function.Thanks, @hdoupe, for the concise bug report.
@MattHJensen @Amy-Xu @andersonfrailey @GoFroggyRun