From ee514811f13c1f5a52a56224c7444a7bd89040a6 Mon Sep 17 00:00:00 2001 From: vahid-ahmadi Date: Sat, 24 Oct 2026 13:43:47 +0100 Subject: [PATCH 1/2] Correct the WPA and liquid fuel descriptions Widowed Parent's Allowance is closed for deaths on or after 6 April 2017, not to new claims (SSCBA 1992 s.39A(1); GOV.UK). Bottled LPG is gas in COICOP (04.5.2), not a liquid fuel (04.5.3). Descriptions only. Co-Authored-By: Claude Opus 5.5 --- changelog.d/wpa-lpg-descriptions.changed.md | 1 + policyengine_uk/data/uprating_indices.yaml | 4 ++-- policyengine_uk/tests/test_heating_fuel_inputs.py | 7 ++++--- .../gov/dwp/widowed_parents_allowance_reported.py | 11 ++++++++--- .../input/consumption/liquid_fuel_consumption.py | 14 ++++++++++---- 5 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 changelog.d/wpa-lpg-descriptions.changed.md diff --git a/changelog.d/wpa-lpg-descriptions.changed.md b/changelog.d/wpa-lpg-descriptions.changed.md new file mode 100644 index 0000000000..1acebe1a9a --- /dev/null +++ b/changelog.d/wpa-lpg-descriptions.changed.md @@ -0,0 +1 @@ +Corrected two descriptions: Widowed Parent's Allowance is closed for deaths on or after 6 April 2017, not to new claims, and liquid_fuel_consumption (COICOP 04.5.3) excludes bottled LPG, which COICOP classes as gas (04.5.2). diff --git a/policyengine_uk/data/uprating_indices.yaml b/policyengine_uk/data/uprating_indices.yaml index 17f363f2cd..82109b860e 100644 --- a/policyengine_uk/data/uprating_indices.yaml +++ b/policyengine_uk/data/uprating_indices.yaml @@ -4,8 +4,8 @@ # An explicit energy_price_basis opts into the variables' existing annual OBR-CPI # assumption from the declared price year. This does not supply an energy-specific # forecast or automatically label existing private Microcosm artifacts. -# liquid_fuel_consumption and solid_fuel_consumption (heating oil, LPG, coal -# and wood) are not in that group: Ofgem's price cap does not cover them, so +# liquid_fuel_consumption and solid_fuel_consumption (heating oil, coal and +# wood) are not in that group: Ofgem's price cap does not cover them, so # they are uprated by CPI from the data year below, like other LCFS spending. # # This map governs dataset projection. Core's class-level variable uprating still diff --git a/policyengine_uk/tests/test_heating_fuel_inputs.py b/policyengine_uk/tests/test_heating_fuel_inputs.py index 418c7b818f..367657b682 100644 --- a/policyengine_uk/tests/test_heating_fuel_inputs.py +++ b/policyengine_uk/tests/test_heating_fuel_inputs.py @@ -1,7 +1,8 @@ """Liquid and solid heating fuel inputs (#2572). -Homes off the gas grid heat with oil, LPG, coal or wood: COICOP 04.5.3 and -04.5.4. Their spending is part of housing_water_and_electricity_consumption, +Homes off the gas grid heat with oil, coal or wood: COICOP 04.5.3 and +04.5.4. (Bottled LPG is gas in COICOP, 04.5.2, so neither input holds it.) +Their spending is part of housing_water_and_electricity_consumption, so the inputs default to zero and add nothing to consumption. Ofgem's price cap does not cover them, so dataset projection uprates them by CPI like other LCFS spending. @@ -55,7 +56,7 @@ def test_defaults_are_zero_and_add_nothing_to_consumption(fuel): def test_fuels_are_uprated_by_cpi_like_other_lcfs_spending(): # Ofgem's cap prices the electricity and gas inputs, which are held at - # their stored prices; it does not cover heating oil, LPG, coal or wood. + # their stored prices; it does not cover heating oil, coal or wood. listed = yaml.safe_load(UPRATING_INDICES.read_text()) for fuel in FUELS: assert fuel not in DATASET_UPRATING_EXCLUSIONS diff --git a/policyengine_uk/variables/gov/dwp/widowed_parents_allowance_reported.py b/policyengine_uk/variables/gov/dwp/widowed_parents_allowance_reported.py index e002ddeec5..1014c67a8f 100644 --- a/policyengine_uk/variables/gov/dwp/widowed_parents_allowance_reported.py +++ b/policyengine_uk/variables/gov/dwp/widowed_parents_allowance_reported.py @@ -10,10 +10,15 @@ class widowed_parents_allowance_reported(Variable): "it shares benefit code 6 with Bereavement Support Payment, and " "datasets built so far put that code in bsp_reported. Its rates rise " "each April with CPI, unlike Bereavement Support Payment's, which " - "have been frozen since April 2017 (see bsp_reported). Closed to new " - "claims since 6 April 2017." + "have been frozen since April 2017 (see bsp_reported). It is closed " + "for deaths on or after 6 April 2017; a new claim can still be made " + "where the partner died before that date (SSCBA 1992 s.39A(1))." ) definition_period = YEAR unit = GBP - reference = "https://www.legislation.gov.uk/uksi/2026/148/article/18/made" + reference = ( + "https://www.legislation.gov.uk/uksi/2026/148/article/18/made", + "https://www.legislation.gov.uk/ukpga/1992/4/section/39A", + "https://www.gov.uk/widowed-parents-allowance", + ) uprating = "gov.economic_assumptions.indices.obr.consumer_price_index" diff --git a/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py b/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py index 4a08ab332e..088a2ff574 100644 --- a/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py +++ b/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py @@ -2,15 +2,20 @@ # COICOP 04.5.3 (liquid fuels). A sub-component of # housing_water_and_electricity_consumption (COICOP 04), so not added into the -# `consumption` total, which already counts it. +# `consumption` total, which already counts it. Liquefied petroleum gas +# (bottled butane and propane) is not a liquid fuel in COICOP: it is gas +# (04.5.2; liquefied hydrocarbons, 04.5.2.2, in COICOP 2018). Microcosm UK +# maps ONS 04.5.3 to liquid fuels and keeps the LCF's bottled gas (b018, +# c45222) in the housing remainder, so the two agree. class liquid_fuel_consumption(Variable): label = "Liquid fuel consumption" documentation = ( - "Annual household spending on liquid fuels such as heating oil and " - "liquefied petroleum gas (COICOP 04.5.3), mostly for heating homes off " - "the gas grid. Already included in " + "Annual household spending on liquid fuels, chiefly heating oil and " + "other domestic fuel oils (COICOP 04.5.3), mostly for heating homes " + "off the gas grid. It excludes liquefied petroleum gas (bottled gas), " + "which COICOP classes as gas (04.5.2). Already included in " "housing_water_and_electricity_consumption; do not add it to " "consumption again. Dataset projection uprates it by CPI from the data " "year, like other LCFS spending: Ofgem's price cap, which prices the " @@ -21,4 +26,5 @@ class liquid_fuel_consumption(Variable): value_type = float unit = GBP quantity_type = FLOW + reference = "https://unstats.un.org/unsd/classifications/unsdclassifications/COICOP_2018_-_pre-edited_white_cover_version_-_2018-12-26.pdf" uprating = "gov.economic_assumptions.indices.obr.consumer_price_index" From 6dc9be39d186f8067469258fdeabec4f2d5dc82e Mon Sep 17 00:00:00 2001 From: vahid-ahmadi Date: Sat, 24 Oct 2026 16:21:06 +0100 Subject: [PATCH 2/2] Drop the liquid fuel description changes Microcosm maps liquid_fuel_consumption to LCF parts that include bottled gas, so main's text was right; #2643 documents it. Keep the WPA fix. Co-Authored-By: Claude Opus 5.5 --- changelog.d/wpa-lpg-descriptions.changed.md | 2 +- policyengine_uk/data/uprating_indices.yaml | 4 ++-- policyengine_uk/tests/test_heating_fuel_inputs.py | 7 +++---- .../input/consumption/liquid_fuel_consumption.py | 14 ++++---------- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/changelog.d/wpa-lpg-descriptions.changed.md b/changelog.d/wpa-lpg-descriptions.changed.md index 1acebe1a9a..02ebe1507e 100644 --- a/changelog.d/wpa-lpg-descriptions.changed.md +++ b/changelog.d/wpa-lpg-descriptions.changed.md @@ -1 +1 @@ -Corrected two descriptions: Widowed Parent's Allowance is closed for deaths on or after 6 April 2017, not to new claims, and liquid_fuel_consumption (COICOP 04.5.3) excludes bottled LPG, which COICOP classes as gas (04.5.2). +Corrected the Widowed Parent's Allowance description: it is closed for deaths on or after 6 April 2017, not to new claims. diff --git a/policyengine_uk/data/uprating_indices.yaml b/policyengine_uk/data/uprating_indices.yaml index 82109b860e..17f363f2cd 100644 --- a/policyengine_uk/data/uprating_indices.yaml +++ b/policyengine_uk/data/uprating_indices.yaml @@ -4,8 +4,8 @@ # An explicit energy_price_basis opts into the variables' existing annual OBR-CPI # assumption from the declared price year. This does not supply an energy-specific # forecast or automatically label existing private Microcosm artifacts. -# liquid_fuel_consumption and solid_fuel_consumption (heating oil, coal and -# wood) are not in that group: Ofgem's price cap does not cover them, so +# liquid_fuel_consumption and solid_fuel_consumption (heating oil, LPG, coal +# and wood) are not in that group: Ofgem's price cap does not cover them, so # they are uprated by CPI from the data year below, like other LCFS spending. # # This map governs dataset projection. Core's class-level variable uprating still diff --git a/policyengine_uk/tests/test_heating_fuel_inputs.py b/policyengine_uk/tests/test_heating_fuel_inputs.py index 367657b682..418c7b818f 100644 --- a/policyengine_uk/tests/test_heating_fuel_inputs.py +++ b/policyengine_uk/tests/test_heating_fuel_inputs.py @@ -1,8 +1,7 @@ """Liquid and solid heating fuel inputs (#2572). -Homes off the gas grid heat with oil, coal or wood: COICOP 04.5.3 and -04.5.4. (Bottled LPG is gas in COICOP, 04.5.2, so neither input holds it.) -Their spending is part of housing_water_and_electricity_consumption, +Homes off the gas grid heat with oil, LPG, coal or wood: COICOP 04.5.3 and +04.5.4. Their spending is part of housing_water_and_electricity_consumption, so the inputs default to zero and add nothing to consumption. Ofgem's price cap does not cover them, so dataset projection uprates them by CPI like other LCFS spending. @@ -56,7 +55,7 @@ def test_defaults_are_zero_and_add_nothing_to_consumption(fuel): def test_fuels_are_uprated_by_cpi_like_other_lcfs_spending(): # Ofgem's cap prices the electricity and gas inputs, which are held at - # their stored prices; it does not cover heating oil, coal or wood. + # their stored prices; it does not cover heating oil, LPG, coal or wood. listed = yaml.safe_load(UPRATING_INDICES.read_text()) for fuel in FUELS: assert fuel not in DATASET_UPRATING_EXCLUSIONS diff --git a/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py b/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py index 088a2ff574..4a08ab332e 100644 --- a/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py +++ b/policyengine_uk/variables/input/consumption/liquid_fuel_consumption.py @@ -2,20 +2,15 @@ # COICOP 04.5.3 (liquid fuels). A sub-component of # housing_water_and_electricity_consumption (COICOP 04), so not added into the -# `consumption` total, which already counts it. Liquefied petroleum gas -# (bottled butane and propane) is not a liquid fuel in COICOP: it is gas -# (04.5.2; liquefied hydrocarbons, 04.5.2.2, in COICOP 2018). Microcosm UK -# maps ONS 04.5.3 to liquid fuels and keeps the LCF's bottled gas (b018, -# c45222) in the housing remainder, so the two agree. +# `consumption` total, which already counts it. class liquid_fuel_consumption(Variable): label = "Liquid fuel consumption" documentation = ( - "Annual household spending on liquid fuels, chiefly heating oil and " - "other domestic fuel oils (COICOP 04.5.3), mostly for heating homes " - "off the gas grid. It excludes liquefied petroleum gas (bottled gas), " - "which COICOP classes as gas (04.5.2). Already included in " + "Annual household spending on liquid fuels such as heating oil and " + "liquefied petroleum gas (COICOP 04.5.3), mostly for heating homes off " + "the gas grid. Already included in " "housing_water_and_electricity_consumption; do not add it to " "consumption again. Dataset projection uprates it by CPI from the data " "year, like other LCFS spending: Ofgem's price cap, which prices the " @@ -26,5 +21,4 @@ class liquid_fuel_consumption(Variable): value_type = float unit = GBP quantity_type = FLOW - reference = "https://unstats.un.org/unsd/classifications/unsdclassifications/COICOP_2018_-_pre-edited_white_cover_version_-_2018-12-26.pdf" uprating = "gov.economic_assumptions.indices.obr.consumer_price_index"