Skip to content

Commit

Permalink
Update price cap test with new consumption values and price value to …
Browse files Browse the repository at this point in the history
…test against
  • Loading branch information
steph_willis committed Oct 28, 2023
1 parent a745466 commit f8a43c0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/test_house.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,19 @@ def test_set_up_house_from_heating_name():


def test_typical_home_hits_price_cap():
# price cap under Energy price guarantee is £2500 for house that uses 12,000kWh of gas and 2,900kWh of elec
# October 2023 price cap for house is 1834 for house that uses 11,500kWh of gas and 2,900kWh of elec
gas_boiler = building_model.HeatingSystem.from_constants(
name='Gas boiler',
parameters=constants.DEFAULT_HEATING_CONSTANTS['Gas boiler'])
demand = 2900 * constants.NORMALIZED_HOURLY_BASE_DEMAND
demand = 2700 * constants.NORMALIZED_HOURLY_BASE_DEMAND
envelope = building_model.BuildingEnvelope(house_type='typical',
annual_heating_demand=12000 * gas_boiler.efficiency,
annual_heating_demand=11500 * gas_boiler.efficiency,
base_electricity_demand_profile_kwh=demand)
gas_house = building_model.House.set_up_from_heating_name(envelope=envelope, heating_name='Gas boiler')
assert gas_house.has_multiple_fuels is True
np.testing.assert_almost_equal(gas_house.annual_consumption_per_fuel_kwh['electricity'], 2900)
np.testing.assert_almost_equal(gas_house.annual_consumption_per_fuel_kwh['gas'], 12000)
np.testing.assert_almost_equal(gas_house.total_annual_bill, 2492.1) # looks like it isn't exactly 2500 after all
np.testing.assert_almost_equal(gas_house.total_annual_bill, 1837, 0) # prices we are using are rounded
np.testing.assert_almost_equal(gas_house.total_annual_tco2,
(12000 * constants.GAS_TCO2_PER_KWH + 2900 * constants.ELEC_TCO2_PER_KWH))
(11500 * constants.GAS_TCO2_PER_KWH + 2700 * constants.ELEC_TCO2_PER_KWH))


def test_upgrade_buildings():
Expand Down

0 comments on commit f8a43c0

Please sign in to comment.