Skip to content

Remove pass-through allowance variables (#414)#1640

Open
vahid-ahmadi wants to merge 1 commit intomainfrom
fix/remove-pass-through-allowance-variables-414
Open

Remove pass-through allowance variables (#414)#1640
vahid-ahmadi wants to merge 1 commit intomainfrom
fix/remove-pass-through-allowance-variables-414

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

  • Removes trading_allowance, property_allowance, and dividend_allowance — three Variables 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.
  • Fixes the taxable_self_employment_income_deductions parameter list to reference trading_allowance_deduction (the amount capped at self_employment_income) rather than the raw trading_allowance. Pre-existing max_(0, ...) meant outputs were already equivalent; this makes the intent explicit.
  • Moves tests that injected these variables as inputs to override the corresponding parameter path instead. Drops the now-meaningless test that asserted the default dividend_allowance value.

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 on main (gift-aid/PA taper, pension annual allowance, marriage allowance); one fewer pass corresponds to the deleted dividend_allowance output assertion.
  • Full CI run (make test) on this branch

🤖 Generated with Claude Code

`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>
@vahid-ahmadi vahid-ahmadi requested a review from MaxGhenis April 21, 2026 11:14
@vahid-ahmadi vahid-ahmadi self-assigned this Apr 21, 2026
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.

Remove allowance variables that are only parameters

1 participant