Skip to content

Speed up cloned geography assignment#939

Merged
MaxGhenis merged 1 commit intomainfrom
codex/fast-geography-collisions
May 10, 2026
Merged

Speed up cloned geography assignment#939
MaxGhenis merged 1 commit intomainfrom
codex/fast-geography-collisions

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • replace per-clone object-string collision scans with a per-record CD-code lookup table
  • resample only records that still collide instead of drawing replacements for every record
  • add a changelog entry

Tests

  • uv run pytest tests/unit/calibration/test_clone_and_assign.py -q
  • uv run ruff check policyengine_us_data/calibration/clone_and_assign.py tests/unit/calibration/test_clone_and_assign.py
  • git diff --check

Local benchmark: a 11,999-household x 430-clone mocked assignment completed in 1.8s.

@MaxGhenis MaxGhenis merged commit dc62ec8 into main May 10, 2026
12 checks passed
@MaxGhenis MaxGhenis deleted the codex/fast-geography-collisions branch May 10, 2026 11:21
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