Tax-Calculator icon indicating copy to clipboard operation
Tax-Calculator copied to clipboard

Parametrize the capital loss limitation amount

Open jdebacker opened this issue 4 years ago • 2 comments

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.

jdebacker avatar Sep 21 '21 20:09 jdebacker

hey, can I have this issue? I'm quite new to this so I might need some guidance

akbhuker avatar Sep 22 '21 04:09 akbhuker

@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:

  1. 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).
  2. 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.
  3. 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)
  1. 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)
  1. 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!

jdebacker avatar Sep 22 '21 12:09 jdebacker

Completed with PR #2707

jdebacker avatar Jan 29 '24 18:01 jdebacker