-
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
Gui input processing #641
Gui input processing #641
Conversation
61b5421
to
c29c3af
Compare
deploy/setup_local_envs.sh
Outdated
@@ -0,0 +1,12 @@ | |||
#!/bin/bash |
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.
This file seems specialized to your development environment -- makes assumptions on paths. Also, not everyone who is working on webapp is also going to be working on ogusa / taxcalc / btax. I think it would be best to leave this out.
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 that's fine with me. I found it to be useful while I was debugging, but I see your point.
@hdoupe I have a couple more comments. Unless i'm mistaken, the only view that uses Also, since Does that seem reasonable? |
webapp/apps/taxbrain/compute.py
Outdated
else: | ||
user_mods = mods | ||
|
||
# if pack_up_user_mods: |
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.
Feel free to go ahead and delete this code.
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, will do. Thanks
@brittainhard said
Both of these suggestions sound reasonable. I'll make these changes by the end of tomorrow. Thanks for reviewing. |
After this PR, the Webapp-public will require Tax-Calculator Version >= 0.10.0. Should we pin the webapp to 0.10.0 in a separate PR instead of lumping that in with the other changes? |
@hdoupe since this PR needs that version, its probably best to specify it here so you can get all the tests working before we merge it. |
The most recent commits refactor |
@hdoupe said in pull request #641:
Thanks for all the work on implementing #619. Hope the rest of your work on #641 goes smoothly. |
@hdoupe this is looking good. Let me know when you are ready for me to review it again. |
Thanks @brittainhard and @martinholmer I should have a first pass of the error handling logic up by the end of the day. @brittainhard I will ping you when that's up. |
The error handling logic still needs some work. I ran into problems mapping the parameter supplied in the error message from My solution was to find the TaxBrain parameter that is either exactly equal to the But, this does not: [EDIT for clarity] The third case fails because we are looking for a parameter-value pair The solution that I have in mind is to specify the The other problem is that if a parameter is initially set within the correct range but inflates out of that range, then an error would not be thrown. This is not desired behavior. Should warning and error messages be shown for all years where the value of the parameter is out of range? Or, given that the value of the parameter is ok initially, should a warning message be shown for just the first year where the value is out of range? The logic here would be to show error/warning message if:
What does everybody think here? I'll take another look at how the error/warning logic worked before, but this may be a good time for everyone to revisit how the errors/warnings worked before and either affirm this behavior or raise objections. |
@hdoupe said:
Then @hdoupe show two Standard Deduction examples that work fine and a third Standard Deduction example that does not. @hdoupe, Maybe I'm slow on the uptake this morning, but can you explain more about why your approach does not work in the third example? |
@martinholmer Sorry for not making that clear enough. I updated my initial comment in an effort to clear things up. |
@hdoupe said:
Have you considered adding to TaxBrain a dictionary that maps non-scalar parameters from the TaxBrain name to the Tax-Calculator name? If I'm not mistaken, your job would be easy if you had the inverse of the The dictionary might look something like this:
Would this dictionary work? If you think it would, I would be happy to add it to the |
@martinholmer That would help. But, I think the issue is that for parameters with a list of values such as |
@hdoupe said:
Yes, thanks for being patient with me. I'm a little slow today. Let me think about this and prepare a Tax-Calculator pull request for you to review to see if it will meet your TaxBrain needs. OK? Wait. I'm still thinking too slow. Is the following the correct way to think about this issue? Our problem is that the error/warning messages have to make sense to both Tax-Calculator users (who know about the parameter names in |
@martinholmer said
Yes, this is the problem. The unedited messages may cause some problems when shown to Tax-Calculator users since they may try the same reform above with |
@martinholmer said
Thanks for your consideration and your working on the problem |
@brittainhard It works with Taxbrain and the dynamic behavioral page. I think it would work with the |
In pull request #641, @hdoupe and @brittainhard discussed PB code like this:
saying things like this:
Parameters names like If there is any confusion about this, we should clear it up immediately. |
@martinholmer Right, we were referring to their equivalent representation in TaxBrain. |
@hdoupe this looks good to me, let me know when you are ready for me to merge it. |
@brittainhard Thanks for the review. This is ready to merge. |
Fix btax backend bug caused by PR #641
This PR addreses issue #619. Thanks to @martinholmer's excellent work on the Tax-Calculator reform processing functions (Tax-Calcuator/PR#1502, Tax-Calculator/PR#1503, Tax-Calcuator/PR#1505), the TaxBrain GUI variables can easily be mapped to the Tax-Calculator variables. This simplifies the processing of these parameters in TaxBrain considerably.
In this PR, I operated under the assumption that almost all of the processing of the parameters would be done in the Tax-Calculator. So, the only validation that is done is to make sure that no extra parameters are posted and that only valid data types are accepted (either floating point, integers, or boolean).
The first commit in this PR moves to the new parameter processing methods but makes the minimum amount of changes required to do this. In the second commit, some of the no longer needed code is removed. The third commit adds some comments.
[EDIT: I had to do some back tracking. The first commit edits the
personal_results
function so that all of the parameter processing is done there. The second commit moves the function converting the fields parameters to json reform style parameters tohelpers.py
. This function is namedto_json_reform
and is called from theprocess_model
function. The third commit pins the webapp to Tax-Calculator version 0.10.0.]TODO List:
minimal_processing
function to forms.py and save parameter values for user-edit functionality@brittainhard @MattHJensen