Add Stage 2 geography assignment boundary#1088
Draft
anth-volk wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1086
Summary
GeographyAssignmentSpecandGeographyAssignmentResultas the Stage 2 geography assignment boundary, including deterministic input identity for seed, household AGI, district AGI targets, and fixed state overrides.geography_assignment_summary.jsonwith clone-major block, county, state, and congressional district availability, lengths, unique counts, checksums, ordering, status, and spec material.Validation
uv run --no-sync python -m py_compile policyengine_us_data/calibration_package/geography.py policyengine_us_data/calibration_package/payload.py policyengine_us_data/calibration_package/specs.py policyengine_us_data/calibration_package/__init__.py policyengine_us_data/calibration/unified_calibration.py policyengine_us_data/stage_contracts/calibration_package.py policyengine_us_data/stage_contracts/calibration_package_schema.pyuv run --no-sync ruff check policyengine_us_data/calibration/unified_calibration.py policyengine_us_data/calibration_package/__init__.py policyengine_us_data/calibration_package/geography.py policyengine_us_data/calibration_package/payload.py policyengine_us_data/calibration_package/specs.py policyengine_us_data/stage_contracts/calibration_package.py policyengine_us_data/stage_contracts/calibration_package_schema.py tests/unit/calibration_package/test_geography.py tests/unit/calibration_package/test_specs.py tests/unit/test_calibration_package_stage_contract.py tests/unit/test_pipeline_docs_extractor.pyuv run --no-sync ruff format --check policyengine_us_data/calibration/unified_calibration.py policyengine_us_data/calibration_package/__init__.py policyengine_us_data/calibration_package/geography.py policyengine_us_data/calibration_package/payload.py policyengine_us_data/calibration_package/specs.py policyengine_us_data/stage_contracts/calibration_package.py policyengine_us_data/stage_contracts/calibration_package_schema.py tests/unit/calibration_package/test_geography.py tests/unit/calibration_package/test_specs.py tests/unit/test_calibration_package_stage_contract.py tests/unit/test_pipeline_docs_extractor.pyuv run --no-sync python -m pytest tests/unit/calibration_package/test_geography.py tests/unit/calibration_package/test_payload.py tests/unit/calibration_package/test_specs.py tests/unit/test_calibration_package_stage_contract.py tests/unit/test_pipeline_docs_extractor.py(56 passed)uv run --no-sync python -m pytest tests/unit/build_outputs/test_geography_loader.py(8 passed)uv run --no-sync python -m pytest tests/unit/calibration/test_target_config.py tests/unit/calibration_package/test_targets.py tests/unit/test_pipeline_doc_guards.py tests/unit/test_remote_calibration_runner.py tests/unit/test_pipeline.py(43 passed, 1 skipped)uv run --no-sync python -m pytest tests/unit/calibration/test_unified_calibration.py::test_calibration_package_contract_parameters_track_effective_matrix_mode tests/unit/calibration/test_unified_calibration.py::test_calibration_package_contract_parameters_ignore_unused_chunk_options tests/unit/calibration/test_unified_calibration.py::TestForbesStateOverrides tests/unit/calibration/test_unified_calibration.py::TestGeographyAssignmentCountyFips tests/unit/calibration/test_unified_calibration.py::TestRunCalibrationAgiTargets::test_uses_requested_db_for_district_agi_targets(7 passed)uv run --no-sync --with pyyaml python scripts/extract_pipeline_docs.py --json /private/tmp/us-data-pr-2e-pipeline-docs/pipeline_map.json --api-json /private/tmp/us-data-pr-2e-pipeline-docs/pipeline_api.json --markdown /private/tmp/us-data-pr-2e-pipeline-docs/pipeline-map.md(148 decorated objects)uv run --no-sync --with pyyaml python scripts/run_quality_guards.pygit diff --checkmake lintNotes
tests/unit/calibration/test_unified_calibration.py. I ran the directly geography/package-related node IDs from that file; a collect-only probe for the full file took about 66 seconds and the selected seven tests took about 2:19, so the whole file was not run to avoid the known heavy local collection/runtime behavior.