Skip to content
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

Parameter validation allows bool value for float parameters #1956

Closed
hdoupe opened this issue Apr 6, 2018 · 1 comment
Closed

Parameter validation allows bool value for float parameters #1956

hdoupe opened this issue Apr 6, 2018 · 1 comment
Assignees
Labels

Comments

@hdoupe
Copy link
Collaborator

hdoupe commented Apr 6, 2018

Cosnider _AMEDT_rt. It should be a float:

>>> dd = taxcalc.Policy.default_data(start_year=2018, metadata=True)
>>> dd['_AMEDT_rt']['integer_value']
False
>>> dd['_AMEDT_rt']['boolean_value']
False

But you can do:

>>> import taxcalc
>>> taxcalc.__version__
'0.18.0'
>>> pol = taxcalc.Policy()
>>> ref = {2019: {'_AMEDT_rt': [True]}}
>>> pol.implement_reform(ref)
>>> pol.reform_errors
''
>>> pol.reform_warnings
''
>>> pol._AMEDT_rt
array([0.009, 0.009, 0.009, 0.009, 0.009, 0.009, 1.   , 1.   , 1.   ,
       1.   , 1.   , 1.   , 1.   , 1.   , 1.   ])

Thus, there are no errors or warnings if you try to do a reform with this value as a boolean type.

@martinholmer
Copy link
Collaborator

Issue #1956 has been resolved by merge of pull request #1960.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants