Remove pass-through allowance variables (#414)#1640
Open
vahid-ahmadi wants to merge 1 commit intomainfrom
Open
Remove pass-through allowance variables (#414)#1640vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi wants to merge 1 commit intomainfrom
Conversation
`trading_allowance`, `property_allowance`, and `dividend_allowance` variables each just returned their same-named parameter. Callers (`trading_allowance_deduction`, `property_allowance_deduction`, `taxable_property_income`, `taxed_dividend_income`) now read the parameter directly. The `taxable_self_employment_income` deductions list now references `trading_allowance_deduction` (the capped amount actually deductible against self-employment income) instead of the raw allowance. This gives identical taxable-income outputs since the pre-existing `max_(0, ...)` clamp already absorbed any over-deduction. Tests that previously injected these variables as inputs now override the corresponding parameter path. The obsolete test that asserted the default `dividend_allowance` value is dropped since the variable no longer exists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
trading_allowance,property_allowance, anddividend_allowance— threeVariables whose formulas only returned the same-named parameter value. Callers (trading_allowance_deduction,property_allowance_deduction,taxable_property_income,taxed_dividend_income) now read those parameters directly.taxable_self_employment_income_deductionsparameter list to referencetrading_allowance_deduction(the amount capped atself_employment_income) rather than the rawtrading_allowance. Pre-existingmax_(0, ...)meant outputs were already equivalent; this makes the intent explicit.dividend_allowancevalue.Closes #414.
Test plan
policyengine-core test policyengine_uk/tests/policy/baseline/gov/hmrc/income_tax -c policyengine_uk— 9 failed / 145 passed, identical 9 preexisting failures onmain(gift-aid/PA taper, pension annual allowance, marriage allowance); one fewer pass corresponds to the deleteddividend_allowanceoutput assertion.make test) on this branch🤖 Generated with Claude Code