-
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
Convert DependentCredit_before_CTC from bool to int #782
Conversation
Are there any other boolean parameters that we would like to convert into comma separated value parameters? My plan is to only convert the ones where we see an obvious use case for allowing changes over time. If we like the behavior introduced for these select parameters, then we can convert the rest of the boolean parameters. I think this will minimize the number of changes to the database. |
@hdoupe, once you feel comfortable with the database changes, I think we should make this change for all boolean parameters, as it is very difficult to anticipate what policymakers will want to delay or sunset. |
@hdoupe said:
OK, but this parameter is boolean in Tax-Calculator. So that means the JSON reform file TaxBrain generates must have them as boolean even though they are presented as 0s and 1s in the TaxBrain GUI. Is there a reason the GUI can't use comma-separated boolean values? |
@MattHJensen Ok, that makes sense. I'll get this on the test app today. If everything goes well, then I will apply this change to the rest of the boolean parameters. |
@martinholmer asked:
The GUI can tolerate comma separated boolean values. However, I think that we should also allow the submission of 1/0 since they are logically equivalent. |
@martinholmer I'm getting the following error when I submit this reform using PR #782 : A simpler example of this reform is run here:
I get the following output:
It seems like 1.0 is not a valid boolean according to Tax-Calculator even though we also have:
PolicyBrain reads the user input from the GUI as strings. The strings with digits are converted to python floats. I could add a special case for the boolean parameters that are entered as 1/0/1.0/0.0 that converts them to 1/0 or True/False. However, I think a better solution would be for Tax-Calculator to accept 1.0 and 0.0 as valid boolean values. @martinholmer what are your thoughts on this? |
Just my 2 cents, I am more eager for TaxBrain to be able to accept True/False than for either TaxBrain or Tax-Calculator to accept 1.0, 1, 0, 0.0. We just have so many numeric inputs, including switches, it refreshing to differentiate switches. |
@MattHJensen Thanks for your insight. I moved your comment to issue #786. Sorry, I probably should have left this PR open longer. I was in a bit of a rush to get this merged, get a pre-release up, and move on to #763. I should have waited longer to make sure that we were all on board. |
Resolves #765. This PR treats
DependentCredit_before_CTC
as an integer instead of a boolean parameter which allows the user to very the parameter's value over time.EDIT:
Old behavior:
New behavior: