Skip to content

Commit

Permalink
GSYE-719: rename test_data.py to constants.py and core_stats to TEST_…
Browse files Browse the repository at this point in the history
…CORE_STATS and area_results_dict to AREA_RESULTS_DICT
  • Loading branch information
BigTava committed Nov 27, 2024
1 parent 785bea9 commit e7f2c03
Showing 1 changed file with 34 additions and 85 deletions.
119 changes: 34 additions & 85 deletions tests/test_sim_results/test_device_statistics.py
Original file line number Diff line number Diff line change
@@ -1,103 +1,52 @@

from gsy_framework.sim_results.device_statistics import DeviceStatistics
from tests.test_sim_results.test_data import core_stats, area_result_dict, current_market_slot
from tests.test_sim_results.constants import (
TEST_CORE_STATS,
TEST_AREA_RESULTS_DICT,
current_market_slot,
)


class TestDeviceStatistics:

@staticmethod
def test_device_statistics_are_correctly_calculated():
device_statistics = DeviceStatistics(True)
device_statistics.update(area_result_dict, core_stats, current_market_slot)
device_statistics.update(TEST_AREA_RESULTS_DICT, TEST_CORE_STATS, current_market_slot)
expected_results = {
"House 2": {
"H2 General Load": {
"trade_price_eur": {
current_market_slot: [0.1771186441]
},
"min_trade_price_eur": {
current_market_slot: 0.17711864
},
"max_trade_price_eur": {
current_market_slot: 0.17711864
},
"trade_energy_kWh": {
current_market_slot: 0.2
},
"min_trade_energy_kWh": {
current_market_slot: 0.2
},
"max_trade_energy_kWh": {
current_market_slot: 0.2
},
"load_profile_kWh": {
current_market_slot: 0.2
},
"min_load_profile_kWh": {
current_market_slot: 0.2
},
"max_load_profile_kWh": {
current_market_slot: 0.2
}
"trade_price_eur": {current_market_slot: [0.1771186441]},
"min_trade_price_eur": {current_market_slot: 0.17711864},
"max_trade_price_eur": {current_market_slot: 0.17711864},
"trade_energy_kWh": {current_market_slot: 0.2},
"min_trade_energy_kWh": {current_market_slot: 0.2},
"max_trade_energy_kWh": {current_market_slot: 0.2},
"load_profile_kWh": {current_market_slot: 0.2},
"min_load_profile_kWh": {current_market_slot: 0.2},
"max_load_profile_kWh": {current_market_slot: 0.2},
},
"H2 PV": {
"trade_price_eur": {
current_market_slot: [0.1771186441]
},
"min_trade_price_eur": {
current_market_slot: 0.17711864
},
"max_trade_price_eur": {
current_market_slot: 0.17711864
},
"trade_energy_kWh": {
current_market_slot: -0.2
},
"min_trade_energy_kWh": {
current_market_slot: -0.2
},
"max_trade_energy_kWh": {
current_market_slot: -0.2
},
"pv_production_kWh": {
current_market_slot: 0.3108
},
"min_pv_production_kWh": {
current_market_slot: 0.3108
},
"max_pv_production_kWh": {
current_market_slot: 0.3108}
"trade_price_eur": {current_market_slot: [0.1771186441]},
"min_trade_price_eur": {current_market_slot: 0.17711864},
"max_trade_price_eur": {current_market_slot: 0.17711864},
"trade_energy_kWh": {current_market_slot: -0.2},
"min_trade_energy_kWh": {current_market_slot: -0.2},
"max_trade_energy_kWh": {current_market_slot: -0.2},
"pv_production_kWh": {current_market_slot: 0.3108},
"min_pv_production_kWh": {current_market_slot: 0.3108},
"max_pv_production_kWh": {current_market_slot: 0.3108},
},
"H2 HeatPump": {
"trade_price_eur": {
current_market_slot: None
},
"min_trade_price_eur": {
current_market_slot: None
},
"max_trade_price_eur": {
current_market_slot: None
},
"trade_energy_kWh": {
current_market_slot: 0
},
"min_trade_energy_kWh": {
current_market_slot: 0
},
"max_trade_energy_kWh": {
current_market_slot: 0
},
"storage_temp_C": {
current_market_slot: 65
},
"energy_consumption_kWh": {
current_market_slot: 10
},
"min_storage_temp_C": {
current_market_slot: 65
},
"max_storage_temp_C": {
current_market_slot: 65}
"trade_price_eur": {current_market_slot: None},
"min_trade_price_eur": {current_market_slot: None},
"max_trade_price_eur": {current_market_slot: None},
"trade_energy_kWh": {current_market_slot: 0},
"min_trade_energy_kWh": {current_market_slot: 0},
"max_trade_energy_kWh": {current_market_slot: 0},
"storage_temp_C": {current_market_slot: 65},
"energy_consumption_kWh": {current_market_slot: 10},
"min_storage_temp_C": {current_market_slot: 65},
"max_storage_temp_C": {current_market_slot: 65},
},
}
}
Expand Down

0 comments on commit e7f2c03

Please sign in to comment.