Skip to content

Consolidate UC work allowance parameters into a single file (#289)#1651

Merged
MaxGhenis merged 1 commit into
mainfrom
refactor/consolidate-uc-work-allowance-289
May 1, 2026
Merged

Consolidate UC work allowance parameters into a single file (#289)#1651
MaxGhenis merged 1 commit into
mainfrom
refactor/consolidate-uc-work-allowance-289

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

Merges parameters/gov/dwp/universal_credit/means_test/work_allowance/with_housing.yaml and .../without_housing.yaml into a single work_allowance.yaml, with the shared metadata (period: month, unit: currency-GBP, uprating: gov.benefit_uprating_cpi, and the SI 2013/376 reg. 22 reference) lifted to the parent node and propagated to children via propagate_metadata_to_children: true.

Per #289, this is "effectively a groupby by whether UC includes housing" and makes related values visible in one place.

The parameter paths gov.dwp.universal_credit.means_test.work_allowance.with_housing and ...without_housing are unchanged — OpenFisca resolves a subdirectory's files and a file's nested dict keys identically, so anything reading these paths (variables, reforms, tests) keeps working.

Closes #289.

Test plan

  • CountryTaxBenefitSystem().parameters.gov.dwp.universal_credit.means_test.work_allowance.{with,without}_housing(...) returns the same values as before (spot-checked 2019-05-01 and 2025-01-01).
  • Metadata (including the reference) propagates correctly onto each child node.
  • All 5 relevant baseline tests pass: work_allowance/is_uc_work_allowance_eligible.yaml, work_allowance/uc_work_allowance.yaml, income/uc_earned_income.yaml.
  • CI green.

🤖 Generated with Claude Code

Merge `work_allowance/with_housing.yaml` and
`work_allowance/without_housing.yaml` into a single
`work_allowance.yaml` with shared metadata (period, unit, uprating,
reference) propagated to children via `propagate_metadata_to_children`.

The parameter path
`gov.dwp.universal_credit.means_test.work_allowance.with_housing`
(and `...without_housing`) is unchanged — OpenFisca treats a file's
dict keys and subdirectory files equivalently. All 5 work_allowance
and uc_earned_income baseline tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi self-assigned this Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: this preserves the same UC work allowance parameter paths while consolidating the YAML node and shared metadata. CI is green.

@MaxGhenis MaxGhenis merged commit 077ae19 into main May 1, 2026
8 checks passed
@MaxGhenis MaxGhenis deleted the refactor/consolidate-uc-work-allowance-289 branch May 1, 2026 16:34
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.

Consolidate UC work allowance parameters into a single file

2 participants