From e7f2c0359805981e0e3875fa76b59bda712af8f1 Mon Sep 17 00:00:00 2001 From: BigTava Date: Wed, 27 Nov 2024 19:42:40 +0000 Subject: [PATCH] GSYE-719: rename test_data.py to constants.py and core_stats to TEST_CORE_STATS and area_results_dict to AREA_RESULTS_DICT --- .../test_device_statistics.py | 119 +++++------------- 1 file changed, 34 insertions(+), 85 deletions(-) diff --git a/tests/test_sim_results/test_device_statistics.py b/tests/test_sim_results/test_device_statistics.py index 2f7796ee..58d3e71b 100644 --- a/tests/test_sim_results/test_device_statistics.py +++ b/tests/test_sim_results/test_device_statistics.py @@ -1,6 +1,9 @@ - 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: @@ -8,96 +11,42 @@ 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}, }, } }