Skip to content

Commit 666cc72

Browse files
authored
Tighten source-backed target profile (#29)
1 parent a68aee6 commit 666cc72

2 files changed

Lines changed: 106 additions & 2 deletions

File tree

src/microplex_us/policyengine/target_profiles.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,15 @@ def _target_cell_key(cell: PolicyEngineUSTargetCell) -> PolicyEngineUSTargetCell
761761
"The PolicyEngine cell is a pregnancy stock by state; live births are "
762762
"a flow and are not a defensible direct source fact for this target."
763763
),
764+
(
765+
"person_count",
766+
"state",
767+
"adjusted_gross_income",
768+
None,
769+
): (
770+
"Loaded SOI state AGI sources provide return counts and AGI amounts, "
771+
"not filer-person counts by AGI band."
772+
),
764773
(
765774
"alimony_expense",
766775
"national",
@@ -834,6 +843,71 @@ def _target_cell_key(cell: PolicyEngineUSTargetCell) -> PolicyEngineUSTargetCell
834843
"PolicyEngine rent is a household survey/model input; ACS rent tables "
835844
"do not provide a direct aggregate source fact for this exact variable."
836845
),
846+
(
847+
"salt",
848+
"national",
849+
"salt",
850+
None,
851+
): (
852+
"SOI Table 2.1 itemized deduction sources cover itemizers; "
853+
"PolicyEngine salt can be positive outside the itemizer domain."
854+
),
855+
(
856+
"tax_unit_count",
857+
"national",
858+
"salt",
859+
None,
860+
): (
861+
"SOI Table 2.1 publishes separate component counts, not the union "
862+
"count of tax units with positive PolicyEngine salt."
863+
),
864+
(
865+
"tax_unit_count",
866+
"national",
867+
"salt,tax_unit_itemizes",
868+
None,
869+
): (
870+
"SOI Table 2.1 publishes separate component counts, not the union "
871+
"count of itemizing tax units with positive PolicyEngine salt."
872+
),
873+
(
874+
"salt",
875+
"state",
876+
"salt",
877+
None,
878+
): (
879+
"Loaded state SOI sources do not provide an exact state-level "
880+
"PolicyEngine salt amount; total state/local taxes also include "
881+
"personal property taxes."
882+
),
883+
(
884+
"salt",
885+
"state",
886+
"salt,tax_unit_itemizes",
887+
None,
888+
): (
889+
"Loaded state SOI sources do not provide state-level itemizer salt "
890+
"as income-or-sales tax plus real estate tax without personal "
891+
"property taxes."
892+
),
893+
(
894+
"tax_unit_count",
895+
"state",
896+
"salt",
897+
None,
898+
): (
899+
"Loaded state SOI sources do not provide the union count of tax units "
900+
"with positive PolicyEngine salt."
901+
),
902+
(
903+
"tax_unit_count",
904+
"state",
905+
"salt,tax_unit_itemizes",
906+
None,
907+
): (
908+
"Loaded state SOI sources do not provide the union count of itemizing "
909+
"tax units with positive PolicyEngine salt."
910+
),
837911
(
838912
"spm_unit_capped_housing_subsidy",
839913
"national",

tests/policyengine/test_target_profiles.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ def test_source_backed_profile_excludes_only_documented_non_source_cells() -> No
370370
}
371371

372372
assert len(broad_cells) == 189
373-
assert len(exclusion_reasons) == 15
373+
assert len(exclusion_reasons) == 23
374374
assert all(reason for reason in exclusion_reasons.values())
375375
assert set(exclusion_reasons) <= broad_cells
376-
assert len(source_backed_cells) == 174
376+
assert len(source_backed_cells) == 166
377377
assert source_backed_cells == broad_cells - set(exclusion_reasons)
378378
assert (
379379
"childcare_expenses",
@@ -387,6 +387,30 @@ def test_source_backed_profile_excludes_only_documented_non_source_cells() -> No
387387
"is_pregnant",
388388
None,
389389
) not in source_backed_cells
390+
assert (
391+
"person_count",
392+
"state",
393+
"adjusted_gross_income",
394+
None,
395+
) not in source_backed_cells
396+
assert (
397+
"salt",
398+
"national",
399+
"salt",
400+
None,
401+
) not in source_backed_cells
402+
assert (
403+
"tax_unit_count",
404+
"national",
405+
"salt,tax_unit_itemizes",
406+
None,
407+
) not in source_backed_cells
408+
assert (
409+
"salt",
410+
"state",
411+
"salt,tax_unit_itemizes",
412+
None,
413+
) not in source_backed_cells
390414
assert (
391415
"employment_income",
392416
"national",
@@ -405,3 +429,9 @@ def test_source_backed_profile_excludes_only_documented_non_source_cells() -> No
405429
None,
406430
None,
407431
) in source_backed_cells
432+
assert (
433+
"salt",
434+
"national",
435+
"salt,tax_unit_itemizes",
436+
None,
437+
) in source_backed_cells

0 commit comments

Comments
 (0)