Skip to content

Fix stock capital period handling#1675

Open
MaxGhenis wants to merge 1 commit into
mainfrom
fix-uk-capital-stock-periods
Open

Fix stock capital period handling#1675
MaxGhenis wants to merge 1 commit into
mainfrom
fix-uk-capital-stock-periods

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

Summary

  • Mark UK capital stock variables as STOCK so monthly calculations do not prorate balances.
  • Preserve stock values when aggregating household capital sources into benefit-unit capital tests for UC, Pension Credit, and Housing Benefit.
  • Add regression tests showing monthly UC and Pension Credit capital calculations keep savings/property/corporate capital as stocks.

Tests

  • uv run pytest policyengine_uk/tests/test_stock_capital_periods.py
  • uv run policyengine-core test policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/is_UC_eligible.yaml policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/pension_credit_deemed_income.yaml policyengine_uk/tests/policy/baseline/finance/benefit/family/income_support/income_support_capital.yaml policyengine_uk/tests/policy/baseline/finance/benefit/family/jsa_income/jsa_income_capital.yaml -c policyengine_uk
  • uv run policyengine-core test policyengine_uk/tests/policy -c policyengine_uk
  • uv run pytest policyengine_uk/tests/ --maxfail=1 -q
  • uv run ruff check policyengine_uk/variables/household/wealth/savings.py policyengine_uk/variables/household/wealth/net_financial_wealth.py policyengine_uk/variables/household/wealth/gross_financial_wealth.py policyengine_uk/variables/household/wealth/total_wealth.py policyengine_uk/variables/gov/hmrc/student_loans/student_loan_balance.py policyengine_uk/variables/gov/dwp/universal_credit/uc_assessable_capital.py policyengine_uk/variables/gov/dwp/universal_credit/uc_reported_capital.py policyengine_uk/variables/gov/dwp/universal_credit/household_uc_reported_capital.py policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_assessable_capital.py policyengine_uk/variables/gov/dwp/pension_credit/pension_credit_assessable_capital.py policyengine_uk/variables/gov/dwp/esa_income_assessable_capital.py policyengine_uk/variables/gov/dwp/jsa_income_assessable_capital.py policyengine_uk/variables/gov/dwp/income_support_assessable_capital.py policyengine_uk/tests/test_stock_capital_periods.py

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.

1 participant