-
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 types #786
Comments
@hdoupe, Tax-Calculator pull request 1782 has been merged. If it would make you work on PolicyBrain any easier, we could make a new 0.14.3 bug-fix release right away. Would that be helpful or not? |
@martinholmer I think you can wait and wrap 1782 into the next regularly scheduled Tax-Calculator release. I already implemented and merged a solution to this issue. This solution is either a long-term fix or a temporary work around depending on whether we decide to go with 1, 2, or 3 above. @martinholmer I'd be interested in your thoughts on approaches 1, 2, or 3 as a I listed above. Essentially, the question is how much responsibility do we want PolicyBrain to have for input validation versus how much responsibility to we want Tax-Calculator (or some other model) to have for input validation. |
@hdoupe, I might be missing something, but isn't a fourth option to only allow inputs that are valid in Tax-Calculator? Based on my current understanding, your preferred approach of (2) still means having extra code in PolicyBrain for validation/conversion. Could we just require the user give an input that is valid for Tax-Calculator and return them a Tax-Calculator error if they don't? |
@MattHJensen said:
The HEAD of the Tax-Calculator master branch considers True,1,1.0 or False,0,0.0 as valid values for boolean policy parameters, which is the way Python handles things (as pointed out by @hdoupe). This has been a useful change because it allows more flexibility in processing JSON reform files that are hand-written by experienced Python programmers working on their local computer, who then want to upload the reform file to TaxBrain. It is a logically separate question about what the TaxBrain GUI should do. Requiring True or False in the TaxBrain GUI might be an advantage in that it emphasizes the type of the policy parameter. Allowing 1,1.0 or 0,0.0 in the GUI seems to assume more computer programming knowledge than most TaxBrain GUI users are likely to have. But no matter what is decided about the TaxBrain GUI, Tax-Calculator will be able to support the decision. |
@martinholmer, thanks for that explanation. That clears up my misunderstanding. |
@martinholmer said
I think TaxBrain should default to True or False but accept 1/0/1.0/0.0 as valid inputs. As @martinholmer pointed out, it is probably more intuitive to TaxBrain users to think about this type of parameter as True/False instead of 1/0. I think defaulting to True/False but accepting 1/0/1.0/0.0 along with the behavior in step 2 accomplishes a few things:
@MattHJensen So we would only allow inputs that are valid taxcalc inputs, but we would also provide a strong hint to indicate the type for the parameter. This does require a little extra code to parse the comma separated boolean strings. However, this code really just deserializes the strings. For example, it converts "1" to |
That makes sense. Thanks @hdoupe! |
@hdoupe said:
Fine, I don't have any strong feelings about how TaxBrain should work. |
@martinholmer @MattHJensen Great, thanks for your feedback. |
Closed via #822 |
In issue #782, @MattHJensen commented:
The current behavior for the new comma separated boolean value allows for case-insensitive "true" and "false" as well as 1.0, 1, 0.0, and 0. These values are then converted into Python boolean type variables (
True
orFalse
).It seems like there are a couple different options for the new comma separated boolean parameters:
True
orFalse
variable, and send the python boolean type variable to Tax-Calculator"false"
-->False
or"1"
-->1
), and send the converted values to Tax-CalculatorI prefer (2). I presented my reasoning in PSLmodels/Tax-Calculator#1782:
However, I would like to hear the perspectives of others on this issue.
The text was updated successfully, but these errors were encountered: