Closed martinholmer closed 6 months ago
I see the issue but I am unsure how the existing mt_head_deductions_exemptions_indiv
does not catch that.
- name: The AGI difference is attributed to the person with the higher AGI and the rest is halved
period: 2021
input:
people:
person1:
is_tax_unit_head: true
mt_agi: 20_000
person2:
is_tax_unit_spouse: true
mt_agi: 18_000
person3:
mt_agi: 0
tax_units:
tax_unit:
members: [person1, person2, person3]
mt_tax_unit_deductions_exemptions_indiv: 10_000
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
mt_head_deductions_exemptions_indiv: 6_000
Unit tests won't catch this because we can broadcast k-element arrays with 1-element arrays (or other k-element arrays). To catch errors broadcasting j- and k-element arrays (e.g., person and tax unit), we need microsimulation tests with multiple tax units, like Martin is doing. I filed https://github.com/PolicyEngine/policyengine-us/issues/3975 to address this.
In the 0.672.1 version, calculating the
mt_income_tax
variable causes the model to crash with the following fatal error message:Please add an integration test that contains a tax unit with more than one person!