Skip to content

Commit 0ebffe6

Browse files
committed
Refactor and improve AEI rebate notebook
- Add SIMULATION_YEAR constant (2026) for clarity - Modularize code with single calculate_rebate_base_statistics() function - Function handles both household and tax_unit calculations via parameter - Add year to all table titles and print statements - Improve ratio column calculation (programmatic, applies to all rows) - Use constants for official statistics (CENSUS_HOUSEHOLDS_2023, IRS_RETURNS_2022) - Always pass explicit year to sim.calculate() calls - Clean up duplicate code between household and tax unit calculations
1 parent 2856cd4 commit 0ebffe6

2 files changed

Lines changed: 40 additions & 518 deletions

File tree

test_current_values.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Save current values before refactoring
2+
print("Recording current values before refactoring...")
3+
print()
4+
print("Expected Household Results:")
5+
print(" Total CA households: 14.2M")
6+
print(" Households with rebate: 3.3M (23%)")
7+
print(" Average rebate base: $18,303")
8+
print(" Total rebate base: $60.5B")
9+
print()
10+
print("Expected Tax Unit Results:")
11+
print(" Total CA tax units: 21.3M")
12+
print(" Tax units with rebate: 8.9M (42%)")
13+
print(" Average rebate base: $16,455")
14+
print(" Total rebate base: $146.5B")

0 commit comments

Comments
 (0)