Skip to content

Add exact geography loader seam#759

Open
anth-volk wants to merge 11 commits intocodex/h5-migration-pr2-typed-request-constructionfrom
codex/h5-migration-pr3a-exact-geography
Open

Add exact geography loader seam#759
anth-volk wants to merge 11 commits intocodex/h5-migration-pr2-typed-request-constructionfrom
codex/h5-migration-pr3a-exact-geography

Conversation

@anth-volk
Copy link
Copy Markdown
Collaborator

Fixes #757

This is PR 3a in the incremental local H5 migration stack.

What this PR does:

  • adds policyengine_us_data/calibration/local_h5/geography_loader.py
  • introduces a class-based CalibrationGeographyLoader as the internal owner of exact geography resolution
  • supports saved geography_assignment.npz, package-backed geography when available, and legacy stacked_blocks.npy fallback
  • keeps publish_local_area.load_calibration_geography(...) as a compatibility wrapper over the new seam
  • adds focused unit tests for geography loading, mismatch failures, fallback behavior, and canonical geometry identity

What this PR does not do:

  • no traceability bundle yet
  • no scope fingerprinting yet
  • no pipeline metadata changes yet
  • no coordinator typed-request changes

Compatibility boundary:

  • public geography helpers remain available
  • artifact names remain unchanged
  • existing publish entrypoints keep the same external behavior

Testing:

  • python -m py_compile policyengine_us_data/calibration/local_h5/geography_loader.py policyengine_us_data/calibration/publish_local_area.py tests/unit/calibration/fixtures/test_local_h5_geography_loader.py tests/unit/calibration/test_local_h5_geography_loader.py
  • ruff check --ignore E402 policyengine_us_data/calibration/local_h5/geography_loader.py policyengine_us_data/calibration/publish_local_area.py tests/unit/calibration/fixtures/test_local_h5_geography_loader.py tests/unit/calibration/test_local_h5_geography_loader.py
  • python -m pytest --noconftest tests/unit/calibration/test_local_h5_geography_loader.py -q
  • result: 5 passed

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pipeline-diagrams Error Error Apr 14, 2026 9:05pm

Request Review

@anth-volk anth-volk force-pushed the codex/h5-migration-pr2-typed-request-construction branch from e076b94 to 25060c9 Compare April 14, 2026 21:51
@anth-volk anth-volk force-pushed the codex/h5-migration-pr2-typed-request-construction branch from d92611c to ddee97f Compare April 15, 2026 19:27
@anth-volk anth-volk force-pushed the codex/h5-migration-pr3a-exact-geography branch from 88ee846 to cf9841e Compare April 15, 2026 19:33
@anth-volk anth-volk marked this pull request as ready for review April 15, 2026 22:52
@anth-volk anth-volk force-pushed the codex/h5-migration-pr2-typed-request-construction branch from a338f7e to f848260 Compare April 17, 2026 22:47
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.

1 participant