From 46e3566bc73200333fe8cd010f31d0c886108b79 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Fri, 9 Oct 2026 04:32:47 +0400 Subject: [PATCH] Add historical Housing Benefit non-dependant scales --- changelog.d/hb-nondep-history.fixed.md | 1 + .../non_dep_deduction/amount.yaml | 180 ++++++++++++++++++ .../test_housing_benefit_non_dep_history.py | 43 +++++ 3 files changed, 224 insertions(+) create mode 100644 changelog.d/hb-nondep-history.fixed.md create mode 100644 policyengine_uk/tests/test_housing_benefit_non_dep_history.py diff --git a/changelog.d/hb-nondep-history.fixed.md b/changelog.d/hb-nondep-history.fixed.md new file mode 100644 index 000000000..c9cb29809 --- /dev/null +++ b/changelog.d/hb-nondep-history.fixed.md @@ -0,0 +1 @@ +- Added the enacted 2015 to 2017 Housing Benefit non-dependant deduction thresholds and amounts instead of backdating the 2018 scale. diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml index ab7e2b269..c0b6b32c4 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml @@ -2,8 +2,38 @@ description: The following amount is provided for individuals under the Housing brackets: - threshold: + 2015-04-01: + value: 0 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 0 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 0 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 0 amount: + 2015-04-01: + value: 14.55 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 14.65 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 14.8 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 15.25 2021-04-01: 15.95 2022-04-01: 16.45 @@ -11,12 +41,42 @@ brackets: 2024-04-01: 19.3 2026-04-01: 20.4 - threshold: + 2015-04-01: + value: 129 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 133 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 136 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 139 2021-04-01: 154 2023-04-01: 162 2024-04-01: 176 2026-04-01: 192 amount: + 2015-04-01: + value: 33.4 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 33.65 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 34 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 35 2021-04-01: 36.65 2022-04-01: 37.8 @@ -24,12 +84,42 @@ brackets: 2024-04-01: 44.4 2026-04-01: 46.85 - threshold: + 2015-04-01: + value: 189 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 195 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 200 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 204 2021-04-01: 224 2023-04-01: 236 2024-04-01: 256 2026-04-01: 279 amount: + 2015-04-01: + value: 45.85 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 46.2 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 46.65 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 48.05 2021-04-01: 50.3 2022-04-01: 51.85 @@ -37,12 +127,42 @@ brackets: 2024-04-01: 60.95 2026-04-01: 64.35 - threshold: + 2015-04-01: + value: 246 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 253 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 259 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 265 2021-04-01: 292 2023-04-01: 308 2024-04-01: 334 2026-04-01: 365 amount: + 2015-04-01: + value: 75.05 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 75.6 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 76.35 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 78.65 2021-04-01: 82.3 2022-04-01: 84.85 @@ -50,12 +170,42 @@ brackets: 2024-04-01: 99.65 2026-04-01: 105.2 - threshold: + 2015-04-01: + value: 328 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 338 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 346 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 354 2021-04-01: 389 2023-04-01: 410 2024-04-01: 445 2026-04-01: 485 amount: + 2015-04-01: + value: 85.45 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 86.1 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 86.95 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 89.55 2021-04-01: 93.7 2022-04-01: 96.6 @@ -63,12 +213,42 @@ brackets: 2024-04-01: 113.5 2026-04-01: 119.85 - threshold: + 2015-04-01: + value: 408 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 420 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 430 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 439 2021-04-01: 484 2023-04-01: 511 2024-04-01: 554 2026-04-01: 605 amount: + 2015-04-01: + value: 93.8 + reference: + - title: 2015 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2015/457/article/18/made + 2016-04-01: + value: 94.5 + reference: + - title: 2016 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/5/made + 2017-04-01: + value: 95.45 + reference: + - title: 2017 Housing Benefit non-dependant deduction uprating + href: https://www.legislation.gov.uk/uksi/2017/260/article/22/made 2018-06-18: 98.3 2021-04-01: 102.85 2022-04-01: 106.05 diff --git a/policyengine_uk/tests/test_housing_benefit_non_dep_history.py b/policyengine_uk/tests/test_housing_benefit_non_dep_history.py new file mode 100644 index 000000000..5ee9a68d5 --- /dev/null +++ b/policyengine_uk/tests/test_housing_benefit_non_dep_history.py @@ -0,0 +1,43 @@ +"""Complete historical HB scale, separate from deduction eligibility rules.""" + +from pathlib import Path + +import numpy as np +import pytest +from policyengine_core.parameters.helpers import load_parameter_file + +PATH = ( + Path(__file__).resolve().parents[1] + / "parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml" +) + + +@pytest.mark.parametrize( + "year, thresholds, amounts", + [ + ( + 2015, + [0, 129, 189, 246, 328, 408], + [14.55, 33.40, 45.85, 75.05, 85.45, 93.80], + ), + ( + 2016, + [0, 133, 195, 253, 338, 420], + [14.65, 33.65, 46.20, 75.60, 86.10, 94.50], + ), + ( + 2017, + [0, 136, 200, 259, 346, 430], + [14.80, 34.00, 46.65, 76.35, 86.95, 95.45], + ), + ], +) +def test_all_historical_scale_cells(year, thresholds, amounts): + # SI 2015/457 art 18(3); SI 2016/242 reg 5; SI 2017/260 art 22(4). + # Test the parameter itself, not the separate #2007 eligibility/banding fix. + scale = load_parameter_file(str(PATH), "hb_non_dep_scale")(f"{year}-04-30") + assert scale.thresholds == thresholds + assert scale.amounts == amounts + np.testing.assert_allclose( + scale.calc(np.array(thresholds)), amounts, rtol=0, atol=0 + )