Tax-Calculator
Tax-Calculator copied to clipboard
Parametrize the capital loss limitation amount
The capital loss limitation amount, which is currently hardcoded into line 432 of calcfunctions.py should be parameterized. It would be useful to allow for separate parameterizations by filing status.
Update: This same hard coded value is also on line 541 in the CapGains function.
hey, can I have this issue? I'm quite new to this so I might need some guidance
@akbhuker Yes, it'd be great if you could take on this issue.
Off the top of my head, I think the things one needs to do are:
- Create a new parameter for the capital loss limitations in
current_law_policy.json(you can use other parameters there as a guide for how to specify this and what to enter into the metadata for the new parameter). - Add this new parameter to the list of arguments for the
calcfunctions.CapGains()function. Note that you'll also want to update the docstring of the function to reflect this new argument. - Update line 541 of calcfunctions.py to use you new parameter. It will be something like:
c01000 = max(-1 * new_parameter_name[MARS-1], c23650)
- Do (2) and (3) for
calcfunctions.ALD_InvInc_ec_base()and line 432, where you'll have something like:
cgain = max(-1 * new_parameter_name[MARS-1], p22250 + p23250)
- Run all the tests. If you set the values for the new capital loss limitation parameter to their current hardcoded values in
current_law_policy.json, all tests should pass as the model will produce the same results as it does now.
When you open a PR, feel free to ping me with questions or specify me as a reviewer.
Thanks!
Completed with PR #2707