From 22e45fe344289439f5dc5f756dc36a5d5c3cbc4e Mon Sep 17 00:00:00 2001 From: Charlotte Avery <143102500+charlotte-avery@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:37:53 +0100 Subject: [PATCH] Revert "Increase HP awareness over time (#143)" This reverts commit 29147c1756b8925faf6b87d15116ae0a6833a2ec. --- k8s/job.jsonnet | 35 --------------------- simulation/__main__.py | 8 ----- simulation/agents.py | 20 ------------ simulation/constants.py | 1 - simulation/costs.py | 4 +-- simulation/model.py | 6 ---- simulation/tests/common.py | 1 - simulation/tests/household_population.csv | 2 +- simulation/tests/test_agents.py | 37 ----------------------- simulation/tests/test_costs.py | 4 +-- simulation/tests/test_main.py | 21 ------------- 11 files changed, 5 insertions(+), 134 deletions(-) diff --git a/k8s/job.jsonnet b/k8s/job.jsonnet index c4ad549..c763e31 100644 --- a/k8s/job.jsonnet +++ b/k8s/job.jsonnet @@ -100,18 +100,6 @@ local job(name, args_excl_output) = { '--price-gbp-per-kwh-electricity', '0.182', ]), - job('03g-%s-awareness-intervention-policy' % std.extVar('SHORT_SHA'), [ - '--intervention', - 'heat_pump_awareness', - '--air-source-heat-pump-price-discount-date', - '2026-01-01:0.3', - '--price-gbp-per-kwh-gas', - '0.0682', - '--price-gbp-per-kwh-electricity', - '0.182', - '--heat-pump-awareness-intervention-factor', - '0.05', - ]), job('04a-%s-max-policy' % std.extVar('SHORT_SHA'), [ '--intervention', 'boiler_upgrade_scheme', @@ -170,29 +158,6 @@ local job(name, args_excl_output) = { '0.182', '--include-new-builds' ]), - job('04d-%s-max-policy-awareness-intervention' % std.extVar('SHORT_SHA'), [ - '--intervention', - 'boiler_upgrade_scheme', - '--intervention', - 'heat_pump_awareness', - '--intervention', - 'gas_oil_boiler_ban', - '--gas-oil-boiler-ban-date', - '2035-01-01', - '--gas-oil-boiler-ban-announce-date', - '2025-01-01', - '--heat-pump-awareness', - '0.5', - '--air-source-heat-pump-price-discount-date', - '2026-01-01:0.3', - '--price-gbp-per-kwh-gas', - '0.0682', - '--price-gbp-per-kwh-electricity', - '0.182', - '--heat-pump-awareness-intervention-factor', - '0.05', - '--include-new-builds', - ]), job('05-%s-max-industry' % std.extVar('SHORT_SHA'), [ '--heat-pump-awareness', '0.5', diff --git a/simulation/__main__.py b/simulation/__main__.py index 1456503..ff7d1b0 100644 --- a/simulation/__main__.py +++ b/simulation/__main__.py @@ -146,13 +146,6 @@ def format_uuid(str): help="Include new build projections (from constants.py). Installers will also build heat pumps in new builds from 2025.", ) - parser.add_argument( - "--heat-pump-awareness-intervention-factor", - type=float_between_0_and_1, - default=0.1, - help="A value between 0 and 1 which determines how quickly heat pump awareness increases over time with the heat pump awareness intervention. A value of 0 is equivalent to not applying the heat pump awareness intervention.", - ) - def check_string_is_isoformat_datetime(string) -> str: datetime.datetime.fromisoformat(string) return string @@ -233,7 +226,6 @@ def validate_args(args): args.heat_pump_installer_count, args.heat_pump_installer_annual_growth_rate, ENGLAND_WALES_ANNUAL_NEW_BUILDS if args.include_new_builds else None, - args.heat_pump_awareness_intervention_factor, ) with smart_open.open(args.history_file, "w") as file: diff --git a/simulation/agents.py b/simulation/agents.py index ff0a4ae..276c130 100644 --- a/simulation/agents.py +++ b/simulation/agents.py @@ -101,11 +101,6 @@ def reverse_sigmoid(x: float, k: float = SIGMOID_K, offset: float = SIGMOID_OFFS return 1 / (1 + math.exp(k * (x + offset))) -def heat_pump_awareness_intervention(x: float, m: float): - - return min(m * x, 1) - - class Household(Agent): def __init__( self, @@ -421,14 +416,6 @@ def get_proba_rule_out_banned_heating_systems(self, model): return reverse_sigmoid(years_to_ban) - def get_proba_becomes_heat_pump_aware(self, model): - - years_since_start = (model.current_datetime - model.start_datetime).days / 365 - - return heat_pump_awareness_intervention( - years_since_start, model.heat_pump_awareness_intervention_factor - ) - def get_heating_system_options( self, model: "DomesticHeatingABM", event_trigger: EventTrigger ) -> Set[HeatingSystem]: @@ -453,13 +440,6 @@ def get_heating_system_options( [HeatingSystem.BOILER_GAS, HeatingSystem.BOILER_OIL] ) - if InterventionType.HEAT_PUMP_AWARENESS in model.interventions: - # if awareness intervention used, allow for more agents to become aware of heat pumps - if not self.is_heat_pump_aware: - self.is_heat_pump_aware = true_with_probability( - self.get_proba_becomes_heat_pump_aware(model) - ) - if not is_gas_oil_boiler_ban_announced: # if a gas/boiler ban is announced, we assume all households are aware of heat pumps if not self.is_heat_pump_aware: diff --git a/simulation/constants.py b/simulation/constants.py index 59eec29..6335079 100644 --- a/simulation/constants.py +++ b/simulation/constants.py @@ -206,7 +206,6 @@ class InterventionType(enum.Enum): BOILER_UPGRADE_SCHEME = 1 GAS_OIL_BOILER_BAN = 2 EXTENDED_BOILER_UPGRADE_SCHEME = 3 - HEAT_PUMP_AWARENESS = 4 # Source: https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/families/datasets/householdsbytypeofhouseholdandfamilyregionsofenglandandukconstituentcountries diff --git a/simulation/costs.py b/simulation/costs.py index c4d1c4c..22e57a1 100644 --- a/simulation/costs.py +++ b/simulation/costs.py @@ -312,7 +312,7 @@ def estimate_boiler_upgrade_scheme_grant( return 0 model_population_scale = ENGLAND_WALES_HOUSEHOLD_COUNT_2020 / model.household_count - boiler_upgrade_funding_cap_gbp = 237_500_000 / model_population_scale + boiler_upgrade_funding_cap_gbp = 450_000_000 / model_population_scale if ( model.boiler_upgrade_scheme_cumulative_spend_gbp >= boiler_upgrade_funding_cap_gbp @@ -345,7 +345,7 @@ def estimate_extended_boiler_upgrade_scheme_grant( return 0 model_population_scale = ENGLAND_WALES_HOUSEHOLD_COUNT_2020 / model.household_count - boiler_upgrade_funding_cap_gbp = 5_400_000_000 / model_population_scale + boiler_upgrade_funding_cap_gbp = 1_650_000_000 / model_population_scale if ( model.boiler_upgrade_scheme_cumulative_spend_gbp >= boiler_upgrade_funding_cap_gbp diff --git a/simulation/model.py b/simulation/model.py index 340eb32..d4c0e2a 100644 --- a/simulation/model.py +++ b/simulation/model.py @@ -46,7 +46,6 @@ def __init__( heat_pump_installer_count: int, heat_pump_installer_annual_growth_rate: float, annual_new_builds: Optional[Dict[int, int]], - heat_pump_awareness_intervention_factor: float, ): self.start_datetime = start_datetime self.step_interval = step_interval @@ -75,9 +74,6 @@ def __init__( ) self.heat_pump_installations_at_current_step = 0 self.annual_new_builds = annual_new_builds - self.heat_pump_awareness_intervention_factor = ( - heat_pump_awareness_intervention_factor - ) super().__init__(UnorderedSpace()) @@ -267,7 +263,6 @@ def create_and_run_simulation( heat_pump_installer_count: int, heat_pump_installer_annual_growth_rate: float, annual_new_builds: Dict[int, int], - heat_pump_awareness_intervention_factor: float, ): model = DomesticHeatingABM( @@ -287,7 +282,6 @@ def create_and_run_simulation( heat_pump_installer_count=heat_pump_installer_count, heat_pump_installer_annual_growth_rate=heat_pump_installer_annual_growth_rate, annual_new_builds=annual_new_builds, - heat_pump_awareness_intervention_factor=heat_pump_awareness_intervention_factor, ) households = create_household_agents( diff --git a/simulation/tests/common.py b/simulation/tests/common.py index ef0cd5b..f79d42b 100644 --- a/simulation/tests/common.py +++ b/simulation/tests/common.py @@ -57,7 +57,6 @@ def model_factory(**model_attributes): "heat_pump_installer_count": 2_800, "heat_pump_installer_annual_growth_rate": 0, "annual_new_builds": None, - "heat_pump_awareness_intervention_factor": 0.0, } return DomesticHeatingABM(**{**default_values, **model_attributes}) diff --git a/simulation/tests/household_population.csv b/simulation/tests/household_population.csv index be625c1..0189697 100644 --- a/simulation/tests/household_population.csv +++ b/simulation/tests/household_population.csv @@ -7,4 +7,4 @@ id,location,property_value_gbp,total_floor_area_m2,is_off_gas_grid,construction_ 5,BIRMINGHAM,500000,100,True,BUILT_PRE_1900,BUNGALOW,MID_TERRACE,BOILER_OIL,F,B,RENTED_SOCIAL,False,3,4,4,False 6,BIRMINGHAM,400000,190,False,BUILT_1900_1929,FLAT,END_TERRACE,BOILER_ELECTRIC,E,C,RENTED_PRIVATE,False,1,4,4,False 7,LONDON,300000,50,True,BUILT_1900_1929,FLAT,SEMI_DETACHED,BOILER_GAS,F,E,OWNER_OCCUPIED,True,2,1,3,True -8,MANCHESTER,600000,80,False,BUILT_PRE_1900,BUNGALOW,MID_TERRACE,BOILER_OIL,B,B,RENTED_PRIVATE,True,2,3,2,False \ No newline at end of file +8,MANCHESTER,600000,80,False,BUILT_PRE_1900,BUNGALOW,MID_TERRACE,BOILER_OIL,B,B,RENTED_PRIVATE,True,2,3,2,False diff --git a/simulation/tests/test_agents.py b/simulation/tests/test_agents.py index ac7f79b..fabc19a 100644 --- a/simulation/tests/test_agents.py +++ b/simulation/tests/test_agents.py @@ -697,43 +697,6 @@ def test_household_ability_to_choose_heat_pump_as_option_depends_on_model_heat_p assert all(heat_pump in heating_system_options for heat_pump in HEAT_PUMPS) - def test_households_increasingly_likely_to_become_heat_pump_aware( - self, - ): - household = household_factory() - model = model_factory( - start_datetime=datetime.datetime(2025, 1, 1), - interventions=[InterventionType.HEAT_PUMP_AWARENESS], - heat_pump_awareness_intervention_factor=0.1, - ) - - proba_becomes_heat_pump_aware = household.get_proba_becomes_heat_pump_aware( - model - ) - - model.increment_timestep() - proba_becomes_heat_pump_aware_updated = ( - household.get_proba_becomes_heat_pump_aware(model) - ) - - assert proba_becomes_heat_pump_aware < proba_becomes_heat_pump_aware_updated - - def test_heat_pump_awareness_increase_is_zero_in_first_year( - self, - ): - household = household_factory() - model = model_factory( - start_datetime=datetime.datetime(2024, 1, 1), - interventions=[InterventionType.HEAT_PUMP_AWARENESS], - heat_pump_awareness_intervention_factor=0.1, - ) - - proba_becomes_heat_pump_aware = household.get_proba_becomes_heat_pump_aware( - model - ) - - assert proba_becomes_heat_pump_aware == 0 - class TestAgentsWithBoilerBan: def test_households_increasingly_likely_to_rule_out_heating_systems_that_will_be_banned_as_time_to_ban_decreases( diff --git a/simulation/tests/test_costs.py b/simulation/tests/test_costs.py index 39ca7f4..0d6e779 100644 --- a/simulation/tests/test_costs.py +++ b/simulation/tests/test_costs.py @@ -227,7 +227,7 @@ def test_boiler_upgrade_scheme_grant_is_zero_when_grant_cap_exceeded( model_population_scale = ( ENGLAND_WALES_HOUSEHOLD_COUNT_2020 / model.household_count ) - boiler_upgrade_scheme_budget_scaled = 237_500_000 / model_population_scale + boiler_upgrade_scheme_budget_scaled = 450_000_000 / model_population_scale model.boiler_upgrade_scheme_cumulative_spend_gbp = ( boiler_upgrade_scheme_budget_scaled * 0.8 @@ -338,7 +338,7 @@ def test_extended_boiler_upgrade_scheme_grant_is_zero_when_grant_cap_exceeded( model_population_scale = ( ENGLAND_WALES_HOUSEHOLD_COUNT_2020 / model.household_count ) - boiler_upgrade_scheme_budget_scaled = 5_400_000_000 / model_population_scale + boiler_upgrade_scheme_budget_scaled = 1_650_000_000 / model_population_scale model.boiler_upgrade_scheme_cumulative_spend_gbp = ( boiler_upgrade_scheme_budget_scaled * 0.8 diff --git a/simulation/tests/test_main.py b/simulation/tests/test_main.py index bf95547..da62c41 100644 --- a/simulation/tests/test_main.py +++ b/simulation/tests/test_main.py @@ -99,24 +99,6 @@ def test_rented_heating_system_hassle_factor_must_be_between_0_and_1( [*mandatory_local_args, "--rented-heating-system-hassle-factor", "10"] ) - def test_heat_pump_awareness_intervention_factor(self, mandatory_local_args): - args = parse_args( - [*mandatory_local_args, "--rented-heating-system-hassle-factor", "0.05"] - ) - assert args.rented_heating_system_hassle_factor == 0.05 - - def test_heat_pump_awareness_intervention_factor_must_be_between_0_and_1( - self, mandatory_local_args - ): - with pytest.raises(SystemExit): - parse_args( - [ - *mandatory_local_args, - "--heat-pump-awareness-intervention-factor", - "10.0", - ] - ) - def test_help_flag(self): with pytest.raises(SystemExit): parse_args(["-h"]) @@ -176,8 +158,6 @@ def test_intervention_argument(self, mandatory_local_args): "boiler_upgrade_scheme", "--intervention", "extended_boiler_upgrade_scheme", - "--intervention", - "heat_pump_awareness", ] ) @@ -185,7 +165,6 @@ def test_intervention_argument(self, mandatory_local_args): InterventionType.RHI, InterventionType.BOILER_UPGRADE_SCHEME, InterventionType.EXTENDED_BOILER_UPGRADE_SCHEME, - InterventionType.HEAT_PUMP_AWARENESS, ] def test_gas_oil_boiler_ban_date_returns_datetime(self, mandatory_local_args):