Fix UC standard allowance reforms being ignored (#1472)#1507
Open
Fix UC standard allowance reforms being ignored (#1472)#1507
Conversation
Move the rebalancing standard allowance uplift from set_input in uc_reform.py into the uc_standard_allowance formula itself. The set_input approach baked values before user reforms were applied, causing parameter reforms to be silently ignored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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
set_input()inuc_reform.pyinto theuc_standard_allowanceformula itselfgov.dwp.universal_credit.standard_allowance.amountare now respectedRoot cause
The UC rebalancing scenario used
sim.set_input("uc_standard_allowance", year, ...)duringSimulation.__init__(), which baked values BEFORE user reforms were applied. The formula was never called, so parameter reforms were silently ignored.Fix
The formula now reads the rebalancing parameters (
rebalancing.activeandrebalancing.standard_allowance_uplift) and applies the uplift multiplicatively to the base amount. Since the formula always runs, user reforms to the base amount are respected.Test plan
Fixes #1472