PreCommit Fixed

This commit is contained in:
Andreas 2024-10-22 10:33:50 +02:00 committed by Andreas
parent c47f071f55
commit cfbe7130e7
2 changed files with 16 additions and 24 deletions

View File

@ -5,7 +5,6 @@ from akkudoktoreos.class_akku import PVAkku
from akkudoktoreos.class_ems import EnergieManagementSystem from akkudoktoreos.class_ems import EnergieManagementSystem
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
from akkudoktoreos.class_inverter import Wechselrichter # Example import from akkudoktoreos.class_inverter import Wechselrichter # Example import
from akkudoktoreos.visualize import *
prediction_hours = 48 prediction_hours = 48
optimization_hours = 24 optimization_hours = 24
@ -201,8 +200,6 @@ def create_ems_instance():
wechselrichter=wechselrichter, wechselrichter=wechselrichter,
) )
return ems return ems

View File

@ -1,6 +1,5 @@
import numpy as np import numpy as np
import pytest import pytest
from akkudoktoreos.visualize import *
from akkudoktoreos.class_akku import PVAkku from akkudoktoreos.class_akku import PVAkku
from akkudoktoreos.class_ems import EnergieManagementSystem from akkudoktoreos.class_ems import EnergieManagementSystem
@ -39,7 +38,6 @@ def create_ems_instance():
pv_prognose_wh[10] = 5000.0 pv_prognose_wh[10] = 5000.0
pv_prognose_wh[11] = 5000.0 pv_prognose_wh[11] = 5000.0
strompreis_euro_pro_wh = np.full(48, 0.001) strompreis_euro_pro_wh = np.full(48, 0.001)
strompreis_euro_pro_wh[0:10] = 0.00001 strompreis_euro_pro_wh[0:10] = 0.00001
strompreis_euro_pro_wh[11:15] = 0.00005 strompreis_euro_pro_wh[11:15] = 0.00005
@ -109,7 +107,6 @@ def create_ems_instance():
wechselrichter=wechselrichter, wechselrichter=wechselrichter,
) )
ac = np.full(prediction_hours, 0) ac = np.full(prediction_hours, 0)
ac[20] = 1 ac[20] = 1
ems.set_akku_ac_charge_hours(ac) ems.set_akku_ac_charge_hours(ac)
@ -213,12 +210,10 @@ def test_simulation(create_ems_instance):
), "'Netzeinspeisung_Wh_pro_Stunde[11]' should be 0.0." ), "'Netzeinspeisung_Wh_pro_Stunde[11]' should be 0.0."
assert ( assert (
abs(result["akku_soc_pro_stunde"][20] - 98 abs(result["akku_soc_pro_stunde"][20] - 98) < 1e-5
) < 1e-5
), "'akku_soc_pro_stunde[11]' should be 98." ), "'akku_soc_pro_stunde[11]' should be 98."
assert ( assert (
abs(result["Last_Wh_pro_Stunde"][20] - 5450.98) < 1e-3 abs(result["Last_Wh_pro_Stunde"][20] - 5450.98) < 1e-3
), "'Netzeinspeisung_Wh_pro_Stunde[11]' should be 0.0." ), "'Netzeinspeisung_Wh_pro_Stunde[11]' should be 0.0."
print("All tests passed successfully.") print("All tests passed successfully.")