8383 build_age_bins ,
8484 build_household_age_matrix ,
8585 create_household_year_h5 ,
86+ household_calibration_weights ,
8687 validate_projected_social_security_cap ,
8788)
8889from tax_assumptions import (
@@ -1115,25 +1116,24 @@ def _print_support_augmentation_summary(augmentation_report: dict) -> None:
11151116 income_tax_values = income_tax_hh .values
11161117
11171118 household_microseries = sim .calculate ("household_id" , map_to = "household" )
1118- # This is the calibrated household-weight decision vector. All ordinary
1119- # baseline aggregates should continue to use MicroSeries methods directly.
1120- baseline_weights = household_microseries .weights .values
1121- household_ids_hh = household_microseries .values
1119+ baseline_weights = household_calibration_weights (sim )
1120+ household_ids_hh = np .asarray (household_microseries .array )
11221121
11231122 income_guard_constraints = {}
11241123 if year >= SUPPORT_AUGMENTATION_START_YEAR :
11251124 for group_name , components in INCOME_GUARD_GROUPS .items ():
11261125 group_values = np .zeros (len (baseline_weights ), dtype = float )
1126+ group_target = 0.0
11271127 included_components = []
11281128 for component in components :
11291129 if component not in sim .tax_benefit_system .variables :
11301130 continue
11311131 component_hh = sim .calculate (component , period = year , map_to = "household" )
11321132 group_values += np .asarray (component_hh .values , dtype = float )
1133+ group_target += float (component_hh .sum ())
11331134 included_components .append (component )
11341135 if not included_components :
11351136 continue
1136- group_target = float (np .sum (group_values * baseline_weights ))
11371137 if abs (group_target ) <= 1e-6 :
11381138 continue
11391139 income_guard_constraints [f"income_guard_{ group_name } " ] = (
@@ -1164,7 +1164,7 @@ def _print_support_augmentation_summary(augmentation_report: dict) -> None:
11641164 ss_values = ss_hh .values
11651165 ss_target = load_ssa_benefit_projections (year )
11661166 if year in display_years :
1167- ss_baseline = np .sum (ss_values * baseline_weights )
1167+ ss_baseline = ss_hh .sum ()
11681168 print (
11691169 f" [DEBUG { year } ] SS baseline: ${ ss_baseline / 1e9 :.1f} B, target: ${ ss_target / 1e9 :.1f} B"
11701170 )
@@ -1190,7 +1190,7 @@ def _print_support_augmentation_summary(augmentation_report: dict) -> None:
11901190 payroll_values = taxable_wages_hh .values + taxable_self_emp_hh .values
11911191 payroll_target = load_taxable_payroll_projections (year )
11921192 if year in display_years :
1193- payroll_baseline = np .sum (payroll_values * baseline_weights )
1193+ payroll_baseline = taxable_wages_hh .sum () + taxable_self_emp_hh . sum ( )
11941194 print (f" [DEBUG { year } ] Payroll cap: ${ payroll_cap :,.0f} " )
11951195 print (
11961196 f" [DEBUG { year } ] Payroll baseline: ${ payroll_baseline / 1e9 :.1f} B, target: ${ payroll_target / 1e9 :.1f} B"
@@ -1231,7 +1231,7 @@ def _print_support_augmentation_summary(augmentation_report: dict) -> None:
12311231
12321232 # Debug output for key years
12331233 if year in display_years :
1234- h6_impact_baseline = np .sum (h6_income_values * baseline_weights )
1234+ h6_impact_baseline = income_tax_reform_hh .sum () - income_tax_hh . sum ( )
12351235 print (
12361236 f" [DEBUG { year } ] H6 baseline revenue: ${ h6_impact_baseline / 1e9 :.3f} B, target: ${ h6_revenue_target / 1e9 :.3f} B"
12371237 )
@@ -1260,8 +1260,8 @@ def _print_support_augmentation_summary(augmentation_report: dict) -> None:
12601260 hi_tob_target = load_hi_tob_projections (year )
12611261
12621262 if year in display_years :
1263- oasdi_baseline = np .sum (oasdi_tob_values * baseline_weights )
1264- hi_baseline = np .sum (hi_tob_values * baseline_weights )
1263+ oasdi_baseline = oasdi_tob_hh .sum ()
1264+ hi_baseline = hi_tob_hh .sum ()
12651265 print (
12661266 f" [DEBUG { year } ] OASDI TOB baseline: ${ oasdi_baseline / 1e9 :.1f} B, target: ${ oasdi_tob_target / 1e9 :.1f} B"
12671267 )
0 commit comments