Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1780.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `bus_fare_spending` Household input variable (COICOP 7.3.2 bus & coach fares), the companion to the LCFS bus fare imputation in policyengine-uk-data, providing the passenger fare households pay (distinct from the ETB-based `bus_subsidy_spending`) as a building block for modelling bus fare reforms. Resolves #1779.
1 change: 1 addition & 0 deletions policyengine_uk/data/uprating_indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gov.economic_assumptions.yoy_growth.obr.average_earnings:
gov.economic_assumptions.yoy_growth.obr.consumer_price_index:
- afcs_reported
- alcohol_and_tobacco_consumption
- bus_fare_spending
- bsp_reported
- carers_allowance_reported
- child_benefit_reported
Expand Down
39 changes: 39 additions & 0 deletions policyengine_uk/tests/test_road_fuel_volume_uprating.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,42 @@ def weighted_litres(household, spending_variable, price_parameter, year):
weighted_litres(household_2034, "diesel_spending", diesel_price, 2034)
* (1 + road_fuel_volume(2035))
)


def test_bus_fare_spending_uses_cpi_uprating():
parameters = system.parameters
cpi = parameters.gov.economic_assumptions.yoy_growth.obr.consumer_price_index

dataset = UKSingleYearDataset(
person=pd.DataFrame(
{
"person_id": [1],
"person_benunit_id": [1],
"person_household_id": [1],
"age": [40],
}
),
benunit=pd.DataFrame({"benunit_id": [1]}),
household=pd.DataFrame(
{
"household_id": [1],
"region": ["LONDON"],
"tenure_type": ["OWNED_OUTRIGHT"],
"council_tax": [1_500.0],
"rent": [0.0],
"household_weight": [1.0],
"bus_fare_spending": [100.0],
}
),
fiscal_year=2025,
)

extended = extend_single_year_dataset(
dataset,
tax_benefit_system_parameters=parameters,
end_year=2026,
)

assert extended[2026].household["bus_fare_spending"].iloc[0] == pytest.approx(
100 * (1 + cpi(2026))
)
17 changes: 17 additions & 0 deletions policyengine_uk/variables/input/consumption/bus_fare_spending.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from policyengine_uk.model_api import *

# COICOP 7.3.2 (passenger transport by road: bus & coach fares). A
# sub-component of transport_consumption, imputed separately from LCFS by
# policyengine-uk-data so bus fare reforms can be modelled. Not added into the
# `consumption` total, which already counts it via transport_consumption.


class bus_fare_spending(Variable):
label = "bus and coach fare spending"
documentation = "Household spending on bus and coach fares (COICOP 7.3.2)."
entity = Household
definition_period = YEAR
value_type = float
unit = GBP
quantity_type = FLOW
uprating = "gov.economic_assumptions.indices.obr.consumer_price_index"