Skip to content

Conversation

@baogorek
Copy link
Collaborator

@baogorek baogorek commented Jan 28, 2026

There will be a lot to say here

This is updating targets where possible

It is also basing local area calibration on 2024 instead of 2023.

Scope is increasing and I want to go ahead and take care of #386 and #387.

baogorek and others added 3 commits January 27, 2026 13:26
Migrate critical database infrastructure from junkyard repo:
- Expand create_database_tables.py with Source, VariableGroup, and
  VariableMetadata tables, ConstraintOperation enum, and improved
  definition hash that includes parent_stratum_id
- Add etl_national_targets.py for loading ~40 national calibration
  targets from CBO, Treasury/JCT, CMS, and other federal sources
- Add utils/db_metadata.py with get_or_create helpers for sources,
  variable groups, and variable metadata
- Add DATABASE_GUIDE.md documenting schema, stratum groups, ETL
  patterns, and SQL query examples
- Standardize all ETL scripts to use calibration/policy_data.db path
- Update Makefile database target to include national targets step

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
These functions were present in the junkyard repo but missing from
the SEP version. Required by ETL scripts like etl_medicaid.py.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Switch the data target to use 2024 CPS data (March 2025 ASEC) instead of
2023. Add CPS_2024_Full for full-sample generation, update ExtendedCPS_2024
and local area calibration to use it. Remove CPS_2021/2022/2023_Full,
PooledCPS, Pooled_3_Year_CPS_2023, ExtendedCPS_2023, dead code, and
unused exports. Update database ETL scripts for strata, IRS SOI, Medicaid,
and SNAP. Trim cps.py __main__ to generate only CPS_2024_Full.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@baogorek
Copy link
Collaborator Author

Wow this was painful.

● X_sparse shape: (32,781, 4,577,564)                                                                                                                         
                                                                                                                                                              
  This matches the expected dimensions from the PORT_JUNKYARD_DB.md plan:                                                                                     
                                                                                                                                                              
  Expected: 53 groups. For full mode with 2024 Medicaid admin (no CD survey): 32,781 targets (33,217 minus 436 CD Medicaid).                                  
                                                                                                                                                              
  The 436 missing targets are the congressional district Medicaid targets, which are intentionally disabled in etl_medicaid.py due to the 119th Congress      
  district code mismatch (the TODO comment about remapping).                                                                                                  
                                                                                                                                                              
  Summary:                                                                                                                                                    
  - 53 target groups ✓                                                                                                                                        
  - 32,781 targets ✓ (correct for 2024 admin-only Medicaid)                                                                                                   
  - 4,577,564 households ✓                                                                                                                                    
                                                                                                                                                              
  The port is complete and verified.                                                                                                                          
                                                                                                                                                              
✻ Churned for 9m 53s             

… strata

Replace simplified DB pipeline with full implementation:
- IRS SOI: 19 conditional strata groups (100-118) with filer population layer
- Variables: income_tax_before_credits, rental_income, self_employment_income,
  net_capital_gains, and complete AGI distribution with tax_unit_count
- Medicaid: 2024 admin data (CD survey disabled pending 119th Congress remap)
- All ETL extract functions now use raw_cache for offline iteration

New files: validate_hierarchy.py, migrate_stratum_group_ids.py, IRS_SOI_DATA_ISSUE.md

Verified: 53 target groups, 32,781 targets, X_sparse (32781, 4577564)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
baogorek and others added 4 commits January 29, 2026 11:06
- Add Modal Volume staging for persistent cache
- Implement parallel build workers (configurable --num-workers)
- Add manifest validation with SHA256 checksums
- Add retry logic with exponential backoff for HF uploads
- Version files under v{version}/ paths
- Update latest.json atomically after all uploads succeed
- Add --skip-upload flag for build-only testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants