policyengine-us
policyengine-us copied to clipboard
Simplify the `ny_supplemental_tax` variable formula
We should break up the formula into multiple variables and use a select for the rate calculation:
rates = tax.main
single = rates.single
joint = rates.joint
hoh = rates.head_of_household
widow = rates.widow
separate = rates.separate
scales = [single, joint, hoh, widow, separate]
previous_agi_threshold = select(
in_each_status,
[
get_previous_threshold(ny_taxable_income, scale.thresholds)
for scale in scales
],
)