Repository navigation
UK firm data: opt-in rateable value and empty-property reader - #1784
Draft
vahid-ahmadi wants to merge 18 commits into
Draft
vahid-ahmadi wants to merge 18 commits into
vahid-ahmadi wants to merge 18 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… against them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port sector-conditional employment, two-universe calibration with per-band registration propensity, stratified thinning with base weights and in_frame/vat_scope flags from firm-microsim-paper. Solve with the public solve_constraint_system (fixes #636) and use the paper's input-ratio imputation (fixes #258). Add the UKFirmRules seam keyed by firm_id, the firm universe helpers, and a policyengine-uk-named firm table export. Name policyengine-uk as the firm rules home in docs/firm-support-plan.md. Refs #1705, PolicyEngine/policyengine-uk#2939. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit the paper's processed 2024-25 tables with provenance and golden numbers from paper runs at aa1ce07 (full, fast and CI modes, seed 42). The engine-free test runs a thinned build and checks exact targets and propensities plus distributional tolerances; tools/firm_paper_parity.py prints the full comparison table. Refs #1705. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share the HMRC band names between firm_universe and firm_generation, remove the unused assign_vat_flags and calculate_vat_liability_values, add UKFirmGenerationConfig.with_vintage, prove thinned solves start from base weights, feed a generated population through the policyengine-uk firm table, rename the parity tool to tools/uk_firm_paper_parity.py, and correct the changelog and docs. Refs #1705. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hash the reference JSON in the fixture provenance with the commands that produced it, assert the golden full run reproduces the paper's published 2024-25 headline, reuse the shared HMRC band names, and note the parity test in the firm support plan. Refs #1705. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pts comparison Carved from #1706's state at bd59841 without the region, legal-status and paybill steps, which move to later PRs of the split. The input-status map covers the 71 policyengine-uk inputs at the committed 0d1c25010 snapshot, with only the base columns set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…apart from the rule period The same-seed thinned 2024-25 population (295,271 rows) is identical, checked exactly against the code before this commit on the same main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…what this PR sets Fable review fixes: the support plan and README no longer say the policyengine-uk adapter is unimplemented; the receipts paybill caveat no longer describes an imputation this PR does not contain; note 4 cites the ONS publication; a FirmRuleOutputs without the VAT output raises ValueError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ompanies and non-profits to charities Region and legal status from ONS UK Business 2025 Tables 8, 12 and 13 (Table 15 held out), the export-group registry with the attributes group, value-free target candidates, and the receipt's data year per input group. ONS status 4 now exports as COMPANY and a public body, status 7 as a charity (assumed); LLPs are a caveat only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paybill, the pay split below the secondary threshold, Employment Allowance flags and take-up, BPE headcount and the labour link, public sector headcount and the 250+ headcount tail, each opt-in and assumed, with sources, data years and receipts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Taxable profit from HMRC Corporation Tax statistics liability bands (CT in-sample) and R&D expenditure from HMRC R&D tax credit statistics, each opt-in and assumed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rateable value from the VOA rating-list stock, opt-in and assumed; the MHCLG empty-property figures as a standalone reader, not wired into the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs #1705, #1706, #1756.
Draft. Step 4c of the #1706 split: opt-in rateable value for UK firms and the empty-property reader.
Stacked. The base stays
mainso that CI runs (the test workflow runs only on PRs that targetmain). Until the PRs below merge, this diff also shows their commits: #1756 (shared firm layer), #1706 (UK paper-parity port), #1781, #1782, #1783. Review only this PR's commit,dc687087d. Carved file by file fromuk-firm-paper-parity-full(f644ab023), as agreed in this comment. Everything here is opt-in and experimental; none of it should feed a published costing yet.What this PR contains
--rateable-value-dir,firm_rateable_value.py): the VOA non-domestic rating stock at 31 March 2026 on the 2023 lists, England, allotted to firms by headcount rank, one property per firm. Labelled assumed; small business rate relief is overstated for multi-site firms.firm_empty_property.py): a standalone reader of MHCLG NNDR1/NNDR3 2024-25 empty-property figures, with diagnostics. It is not wired into the build;firm_property_occupiedandfirm_months_emptystay unset (a stock on one date is not "empty all year", empty hereditaments are not trading firms, and months empty could only be fitted to a relief total). The empty-property share andfirm_n_propertiesstay gaps.rateable_value; fixtures with provenance and extract tools.voa_rating_list.Checks
test_uk_receipt_counts,test_uk_runtime_exportsand the sharedtest_firm_*files pass; ruff check and format pass on the changed files;tools/ci_test_plan.py verifypasses. The full engine-free suite was not run locally.🤖 Generated with Claude Code