Parse NIC Classes 2, 3 and 4 from OBR EFO Table 3.4#355
Merged
Conversation
Contributor
Author
|
Self-review: APPROVE. See |
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.
Summary
policyengine_uk_data/targets/sources/obr.py::_parse_nicsonly covered Class 1 Employee and Class 1 Employer NICs, omitting:That's ~£2-5B/yr of NIC receipts with no calibration target, which biased the model into pushing self-employment income downward to compensate and distorted reforms touching SE income.
This PR:
_parse_nics, emittingTargets with the matchingpolicyengine_ukvariable names (ni_class_2,ni_class_3,ni_class_4).Adds
test_obr_nics.py, which drives the parser against an in-memory openpyxl workbook that mirrors OBR's Table 3.4 layout (canonical labels + the common wording variants).Test plan
uv run pytest policyengine_uk_data/tests/test_obr_nics.py -qpasses.Finding U8 from the bug hunt.