-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Modify section headings in policy_current_law.json #2372
Conversation
@Peter-Metz, I added a WIP label for now since the tests aren't passing. Could you ping me again when they are, and then I'll be happy to review? |
Codecov Report
@@ Coverage Diff @@
## master #2372 +/- ##
======================================
Coverage 100% 100%
======================================
Files 13 13
Lines 2748 2748
======================================
Hits 2748 2748 Continue to review full report at Codecov.
|
@MattHJensen tests now pass after some modifications to |
@Peter-Metz, thanks again for opening this PR. After reviewing this more closely, I remember some context that might be helpful: The previous version of Tax-Brain at OSPC.org did not display parameters that were not assigned section headers. You can confirm at ospc.org/taxbrain. This is a relic of when the Tax-Calculator and Tax-Brain teams were more tightly integrated, and the Tax-Calculator team would use the absence of section headers to indicate that a parameter shouldn't appear on Tax-Brain for some reason of user safety. It was introduced in #1109. I strongly suggest that apps using Tax-Calculator adopt the same rule for now -- i.e., don't display parameters that don't have Tax-Calculator section headers. (cc @andersonfrailey @hdoupe @jdebacker) The Tax-Calculator project will also review how we indicate a parameter's safety for users and whether any of the un-section-headered parameters are actually safe. @Peter-Metz, if all of this makes sense to you, then I think it would be helpful to narrow the scope of this PR to:
|
You can choose which parameters are available on compute.studio by doing something like this: def get_inputs(meta_params_dict):
"""
Return default parameters for Tax-Brain
"""
metaparams = MetaParameters()
metaparams.adjust(meta_params_dict)
policy_params = TCParams()
policy_params.set_state(
year=metaparams.year.tolist(),
data_source=metaparams.data_source.tolist(),
)
# Only keep "schema" object and parameters that have a section_1
filtered_pol_params = OrderedDict()
for k, v in policy_params.dump().items():
if k == "schema" or v.get("section_1", False):
filtered_pol_params[k] = v
behavior_params = BehaviorParams()
default_params = {
"policy": filtered_pol_params,
"behavior": behavior_params.dump()
}
meta = metaparams.dump()
return {"meta_parameters": meta, "model_parameters": default_params} |
Thanks @MattHJensen, I'll update this PR in the next couple of days. Also thanks @hdoupe for the suggestion re: compute studio |
@MattHJensen: the latest commits reinstate the un-sectioned params (keeping the modified |
@@ -699,26 +699,18 @@ def generate_section_dictionary(html_text): | |||
'Additional Medicare FICA': 0 | |||
}, | |||
'Social Security Taxability': { |
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.
@Peter-Metz, could you help me understand what is going on in test_policy.py?
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.
@MattHJensen sure thing. The gist is that test_policy
creates a dictionary called valid_dict
and compares it to policy_current_law
to check section_1
and section_2
titles. For example:
valid_dict = {
# corresponds to PCL section_1
'Payroll Taxes': {
# corresponds to PCL section_2
'Social Security FICA': 0
}
Since this PR removes some of the section_2
titles, we modify valid_dict
with:
valid_dict = {
'Payroll Taxes': {
'': 0
}
Does that clear things up?
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.
Thanks, @Peter-Metz
Thanks for this PR, @Peter-Metz! |
This PR modifies certain
section_1
andsection_2
headings inpolicy_current_law.json
. The need arose because there is a group of unorganized/unsectioned parameters in Tax-Brain and Tax-Cruncher because they are not assigned asection_1
(see the first screenshot for an example). In the process, I also modified a few of thesection_2
headings because they were the same as the parameters' descriptions (see the second screenshot for an example).I modified a test in
test_policy.py
but it still fails because the section headings do not matchuguide.htmx
. What is the process for updatinguguide.htmx
?Un-sectioned parameters:
Example of section_2 mirroring parameter description: