-
Notifications
You must be signed in to change notification settings - Fork 32
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
EITC phase-in rate values being changed #596
Comments
The following code from the
|
@martinholmer said
That makes sense to me. We could do something like this:
|
@hdoupe that could work. I would pull in @MattHJensen and draw his attention to issue #160 which explains the rationale for the original change. I would then propose the creation of some set of |
Before deciding how to fix the bug being discussed in webapp-public issue #596 (which was reported by a TaxBrain user), let's take a step back to consider some basic issues. (1) The cause of the bug seems to be this function, which would be more appropriately named
(2) This function is called not only with a Policy parameters object as the (3) My basic question is why do parameter values need to be rounded in TaxBrain. The comment in the check-in that added the offending function said this:
So, why exactly did "we choose to round them to the nearest dollar"? Aren't all the dollar-valued policy parameters for years 2017 and before that are being displayed in the TaxBrain GUI already expressed in whole dollars in the |
I agree that no rounding makes things easier. The issue, as I recall, is that parameters that were CPI-inflated to cover the budget window were not being rounded at all, which was seen as undesirable by @MattHJensen, that is my recollection anyway. An easy fix would be to remove all rounding code, which would allow entry of parameters that are not whole dollars. Additionally, any default parameters for a year, e.g. 2017, which are computed via inflation of a specified parameter for a prior year (e.g. a parameter with a default value given for 2016), would show up as their full floating point value, not rounded to a whole dollar. |
@talumbau said about issue #596:
I think this is a good first step: turn off all the TaxBrain rounding. Then we can see exactly where we stand with respect to TaxBrain GUI readability. My understanding is that all the dollar-valued policy parameters for 2017 (and earlier years) are expressed as whole numbers. So, just adding one line to the function will "turn off" the rounding, right?
This minimal change will make it easy to go back to where we are now in case we need to do that. Can we add that one line and then do some local testing? |
@martinholmer That sounds sensible to me. I can make the change and compare the results from a local taxbrain instance and taxcalc with the reform:
|
@hdoupe said:
Sound good, but maybe try something other than all 1.5 so that you know which way to rounding would go under current version. Maybe |
@martinholmer said
Good idea. I'll give that a shot. |
@martinholmer I decided to use the reform: [[0.75,1.4,1.6,1,6]]. Before removing the rounding function the keywords to dropq were :
The results after removing the rounding:
Changing |
@hdoupe said:
What did you do to remove the rounding? @hdoupe said:
This function is called many times in several different files, but maybe it doesn't effect reform specifications. Can you trace TaxBrain GUI to see where the values greater than one are set to one? Or, better yet, maybe the people who wrote the TaxBrain code can tell you where to look. |
@martinholmer I did exactly what you recommended:
I searched the directory and the function
|
@hdoupe said:
Yes, that's true. But search to see how many times What does @brittainhard say about where in the code the |
The experiments conducted by @hdoupe indicate that the As I continue to explore the code in the
Notice that the two statements marked with a If this is the source of the error, then I have the same question as before: why is TaxBrain changing the parameter values specified by users? What is the rationale for changing user specified values? |
I believe that you are pointing to the correct place in the code where the int conversion occurs.
Looking at the history of helpers.py, the code has forced an int conversion of user parameters (that were not rates) since at least July of 2015, which is the full length of time of the existence of this repo. Discussions/code changes prior to that were on the old version of the repo, which was a private repo and I believe it was deleted. My recollection is that this was a user request. If the private repo is still around, it might be worthwhile to search the issue history or do a "git blame" operation to see if there are helpful commit messages for these changes. Besides just being a user request, there's another reason to truncate to integer: it brings consistency to the Of course, one can still apply the above logic to |
@talumbau said about the webapp-public code that causes the #596 bug:
All that is true except for the So, you are correct that the #596 bug, which was reported by a TaxBrain user who is not part of the development team, has been present in the code since at least July 2015. @talumbau also said:
What you say is true only if we continue to use what seems to me a sub-optimal approach to sending the TaxBrain Input GUI information to Tax-Calculator. It seems to me that all the problems you describe go away if we make a change in how the Input GUI info is sent to Tax-Calculator. Why doesn't TaxBrain translate the information that is changed by a user into a JSON reform file and then send that file to Tax-Calculator (in the same way as the TaxBrain File Upload page does)? This approach seems to by-pass the Let me illustrate what I mean using a simple example. Suppose a TaxBrain user wants to analyze a this reform when the start year is 2017: Social Security payroll tax rate: In words, the reform raises the tax rate to 0.130 beginning in 2018, and raises the MTE in two steps: to $350,000 in 2020 with indexing after that and to $450,000 in 2023 with indexing after that. Here is what the JSON reform file looks like for this reform:
Notice that there are no leading or intermediate indexed values that need to be computed and used to characterize the reform, thus simplifying the work of TaxBrain to communicate to Tax-Calculator what the reform is. Would it be possible for the JavaScript that is controlling the logic of the TaxBrain Input GUI to make this translation using only the input boxes that have been changed? Sending such a JSON reform file to the TaxBrain server would be much easier that sending all the changed and unchanged parameter values (which is how things work now if I understand your explanation of the POST logic). Once such a JSON reform file was received by the TaxBrain server, the current version of Tax-Calculator offers the capability of converting such a JSON reform file into a Perhaps I'm missing something here, but Tax-Calculator has a broader set of capabilities than it had when TaxBrain was originally designed. Maybe we should be simplifying TaxBrain (and eliminating what are now code duplications) by making use of these new Tax-Calculator capabilities. |
Actually, that is not correct. If you look at the version of the
This seems like a good idea. I just have one question: what is the proper JSON reform file for this entry in TaxBrain? This is the If this is a trivial transformation, then I think what you suggest would be trivial to implement (although I would not be the one doing the work so it's easy for me to say this). I would go further and say that if it is not trivial, I would suggest that Tax-Calculator be modified so that it is trivial to specify such a reform in a JSON reform file. For example, perhaps should be a valid reform specification:
So here I'm suggesting that suffixes like |
@talumbau said in the discussion of the #596 bug:
@talumbau thanks for your thoughtful and creative response. I have just started looking into the issues you raise, so these are tentative answers to your two questions. I will continue looking into the issues you raise, but at the moment I'm optimistic about the approach you're suggesting. The answer to your first question is NO. The answer to your second question is YES, I think. @MattHJensen @Amy-Xu @andersonfrailey @hdoupe @GoFroggyRun |
Closed via #641 |
This issue was initially raised in Tax-Calculator issue #1485.
@MattHJensen said
Here are results from the celery log when I ran the two reforms mentioned above. Celery log for
_EITC_rt
set to 1:and
_EITC_rt
set to 1.5:There are two problems here:
_EITC_rt
is being rounded down when it shouldn't be. This may be an issue with other parameters, too. I'm not sure what the acceptable range would be for this parameter.@martinholmer @PeterDSteinberg @brittainhard
The text was updated successfully, but these errors were encountered: