From bf6dfe8a52b60754a434b1ee7373c91a3a8472ce Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:16:41 +0000 Subject: [PATCH] Align Scottish income tax with SFC baseline (#999) * Fix Budget change reforms break on subset simulations #994 * Add AHC income * Ensure scottish taxes are updated * Versioning --- CHANGELOG.md | 7 +++ changelog.yaml | 5 ++ .../hmrc/income_tax/rates/scotland/rates.yaml | 54 ++++++++++++------- .../variables/household/income/income.py | 38 +++++++++++++ setup.py | 2 +- 5 files changed, 87 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcda450ba..623952986 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.17.0] - 2024-12-04 16:48:42 + +### Fixed + +- Scottish baseline matched with Scottish Fiscal Commission. + ## [2.16.0] - 2024-11-28 16:54:41 ### Changed @@ -1603,6 +1609,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[2.17.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.16.0...2.17.0 [2.16.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.15.1...2.16.0 [2.15.1]: https://github.com/PolicyEngine/openfisca-uk/compare/2.15.0...2.15.1 [2.15.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.14.1...2.15.0 diff --git a/changelog.yaml b/changelog.yaml index 8b535e451..8f68232ce 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1345,3 +1345,8 @@ changed: - Pinned UK data to 1.9.0. date: 2024-11-28 16:54:41 +- bump: minor + changes: + fixed: + - Scottish baseline matched with Scottish Fiscal Commission. + date: 2024-12-04 16:48:42 diff --git a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/rates.yaml b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/rates.yaml index d38bdf5f2..c70a4e09e 100644 --- a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/rates.yaml +++ b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/rates.yaml @@ -1,42 +1,60 @@ description: Rates for Scottish Income Tax brackets: - threshold: - 2021-04-06: 0 + values: + 2021-04-06: 0 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: 0.19 # Starter rate - threshold: - 2021-04-06: 2_306 - 2022-04-06: 2_162 - 2023-04-06: 2_162 - 2024-04-06: 2_097 + values: + 2021-04-06: 2_306 + 2022-04-06: 2_162 + 2023-04-06: 2_162 + 2024-04-06: 2_306 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: 0.20 # Basic rate - threshold: - 2021-04-06: 13_991 - 2022-04-06: 13_118 - 2023-04-06: 13_118 - 2024-04-06: 12_726 + values: + 2021-04-06: 13_991 + 2022-04-06: 13_118 + 2023-04-06: 13_118 + 2024-04-06: 13_991 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: 0.21 # Intermediate rate - threshold: - 2021-04-06: 31_092 - 2022-04-06: 31_092 - 2023-04-06: 31_092 - 2024-04-06: 31_092 + values: + 2021-04-06: 31_092 + 2022-04-06: 31_092 + 2023-04-06: 31_092 + 2024-04-06: 31_092 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: 0.41 # Higher rate 2023-04-06: 0.42 - threshold: - 2021-04-06: 150_000 - 2023-04-06: 125_140 - 2024-04-06: 62_430 + values: + 2021-04-06: 150_000 + 2023-04-06: 125_140 + 2024-04-06: 62_430 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: 0.46 # Additional rate 2023-04-06: 0.47 2024-04-06: 0.45 - threshold: - 2021-04-06: null - 2024-04-06: 125_140 + values: + 2021-04-06: null + 2024-04-06: 125_140 + metadata: + uprating: gov.obr.consumer_price_index rate: 2021-04-06: null 2024-04-06: 0.48 diff --git a/policyengine_uk/variables/household/income/income.py b/policyengine_uk/variables/household/income/income.py index 81be2cd11..50fd8de97 100644 --- a/policyengine_uk/variables/household/income/income.py +++ b/policyengine_uk/variables/household/income/income.py @@ -200,6 +200,30 @@ def formula(household, period, parameters): return np.round(market_income + benefits - tax) +class household_net_income_ahc(Variable): + label = "household net income" + documentation = "household net income" + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + adds = [ + "household_market_income", + "household_benefits", + ] + subtracts = [ + "household_tax", + "housing_costs", + ] + + def formula(household, period, parameters): + market_income = household("household_market_income", period) + benefits = household("household_benefits", period) + tax = household("household_tax", period) + housing_costs = household("housing_costs", period) + return np.round(market_income + benefits - tax - housing_costs) + + class inflation_adjustment(Variable): label = ( f"inflation multiplier to get {datetime.datetime.now().year} prices" @@ -230,6 +254,20 @@ def formula(household, period, parameters): return net_income * household("inflation_adjustment", period) +class real_household_net_income_ahc(Variable): + label = ( + f"real household net income ({datetime.datetime.now().year} prices)" + ) + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + + def formula(household, period, parameters): + net_income = household("household_net_income_ahc", period) + return net_income * household("inflation_adjustment", period) + + class hbai_household_net_income_ahc(Variable): value_type = float entity = Household diff --git a/setup.py b/setup.py index 4eea7cac3..df5abd8c0 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="PolicyEngine-UK", - version="2.16.0", + version="2.17.0", author="PolicyEngine", author_email="nikhil@policyengine.org", classifiers=[