PolicyEngine / policyengine-us

The PolicyEngine US Python package contains a rules engine of the US tax-benefit system, and microdata generation for microsimulation analysis.
https://policyengine.org/us
GNU Affero General Public License v3.0
102 stars 175 forks source link

Refactor the `regular_tax_before_credits` variable and add unit tests #4817

Open PavelMakarchuk opened 2 months ago

PavelMakarchuk commented 2 months ago

It currently includes a number of variables which are not descriptive as well as calculation steps which do not seem transparent

First step would be to compare the calculation to capital_gains_tax (up until the inclusion of income_tax_main_rates) and to identify which steps can be consolidated for clarity

Secondly, unit tests should be added to test the file - it will be not done in #4815

We should also add references and tie the hard coded 0.28 parameter from the dwks41 calculation to the amt bracket parameter which is refactored in #4815

MaxGhenis commented 2 months ago

The last part is https://github.com/PolicyEngine/policyengine-us/issues/3279

PavelMakarchuk commented 1 month ago

Forms