Repository navigation
Conversation
anth-volk
added this pull request to stack #3917
October 14, 2026 21:56
anth-volk
force-pushed
the
remove-economy-comparison
branch
4 times, most recently
from
October 15, 2026 00:06
a6b3066 to
8887f8e
Compare
policyengine_api/services/economy_comparison.py has had no caller in the package since #2569 removed the Public API's own society-wide simulations; only its tests and snapshot data used it. Remove the module, its unit and snapshot tests, and the route-boundary test that checked it stayed out of the HTTP layer. api.routes.no-domain-logic-in-http now covers the calculation route alone, and a docstring that pointed at the module now points at the codebase's other Pydantic models. Nothing in the package imports microdf any more, but microdf_python stays declared; removing an unused dependency is a separate cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
remove-economy-comparison
branch
from
October 15, 2026 15:21
8887f8e to
89149d0
Compare
This branch has not been deployed
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 #3935
Summary
Stacked on #3934.
policyengine_api/services/economy_comparison.pyhas had no caller in the package since #2569, which removed the Public API's own society-wide simulations. This PR removes the module with its unit tests, its snapshot tests and its snapshot data: 915 lines of code, about 1,600 lines of tests and an 8,000-line JSON file.policyengine_apiimports the module. The only other matches foreconomy_comparisonare theeconomy_comparisonreport kind inreport_spec_service.py, which is a string, and a docstring.uk_constituency_breakdownanduk_local_authority_breakdowndownloaded the enhanced FRS constituency and local-authority weight matrices. UK: certify a Microcosm national dataset as the UK default, with separate national and local-area datasets and a corrected local-authority list policyengine.py#553 lists that as a Public API dependency to resolve before a Microcosm UK default.api.routes.no-domain-logic-in-httpdropstest_economy_comparison_logic_is_not_in_the_http_layer, which only checked that the module stayed out of the HTTP layer.AGENTS.mdanddocs/generated/rules.mdare re-rendered.microdf_pythonstays declared, although nothing imports microdf any more. Removing an unused dependency is a separate cleanup; step 2.7's dependency check would flag it.The weighted-microdata rules (step 1.9) are the next PR in the stack. With this module gone, they start enforced with no findings.
Testing
pytest tests/unit: 2,727 passed. The 97 removed tests are exactly the module's unit and snapshot tests, plus the one route-boundary test.uv run --frozen --extra dev mypy: no issues. The module was outside the type-check scope, so the file count is unchanged.python scripts/run_quality_guards.py: migration-contracts, rules-registry and ci-scripts passed.python -m scripts.rules renderleaves no diff, andpython -m scripts.rules guardpasses.ruff check .andruff format --check .(ruff 0.15.12, fromuv.lock) are clean.🤖 Generated with Claude Code