renamed haushaltsgeräte to home appliance (#196)

* * rename Haushaltsgeraete to home appliance
* renamed strafe to penalty (optimization problem)

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* removed penalty renaming

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* renamed one variable

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* * renamed variable names and methods of the home appliance class

* renamed missed method names

* fixed renamed variable

* renamed object

* adjusted to latest repo changes

* renamed file to class_home_applianc.py

* renamed method

---------

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel
2024-11-26 00:53:16 +01:00
committed by GitHub
parent 12679b6ab1
commit 2a163569bc
16 changed files with 174 additions and 107 deletions

View File

@@ -3,7 +3,7 @@ import pytest
from akkudoktoreos.config import AppConfig
from akkudoktoreos.devices.battery import EAutoParameters, PVAkku, PVAkkuParameters
from akkudoktoreos.devices.generic import Haushaltsgeraet, HaushaltsgeraetParameters
from akkudoktoreos.devices.generic import HomeAppliance, HomeApplianceParameters
from akkudoktoreos.devices.inverter import Wechselrichter, WechselrichterParameters
from akkudoktoreos.prediction.ems import (
EnergieManagementSystem,
@@ -28,14 +28,14 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
wechselrichter = Wechselrichter(WechselrichterParameters(max_leistung_wh=10000), akku)
# Household device (currently not used, set to None)
home_appliance = Haushaltsgeraet(
HaushaltsgeraetParameters(
verbrauch_wh=2000,
dauer_h=2,
home_appliance = HomeAppliance(
HomeApplianceParameters(
consumption_wh=2000,
duration_h=2,
),
hours=prediction_hours,
)
home_appliance.set_startzeitpunkt(2)
home_appliance.set_starting_time(2)
# Example initialization of electric car battery
eauto = PVAkku(
@@ -212,7 +212,7 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
gesamtlast=gesamtlast,
),
eauto=eauto,
haushaltsgeraet=home_appliance,
home_appliance=home_appliance,
wechselrichter=wechselrichter,
)
@@ -270,7 +270,7 @@ def test_simulation(create_ems_instance):
"Gesamtkosten_Euro",
"Verluste_Pro_Stunde",
"Gesamt_Verluste",
"Haushaltsgeraet_wh_pro_stunde",
"Home_appliance_wh_per_hour",
]
for key in expected_keys:
@@ -338,18 +338,18 @@ def test_simulation(create_ems_instance):
# Check home appliances
assert (
sum(ems.haushaltsgeraet.get_lastkurve()) == 2000
), "The sum of 'ems.haushaltsgeraet.get_lastkurve()' should be 2000."
sum(ems.home_appliance.get_load_curve()) == 2000
), "The sum of 'ems.home_appliance.get_load_curve()' should be 2000."
assert (
np.nansum(
np.where(
np.equal(result["Haushaltsgeraet_wh_pro_stunde"], None),
np.equal(result["Home_appliance_wh_per_hour"], None),
np.nan,
np.array(result["Haushaltsgeraet_wh_pro_stunde"]),
np.array(result["Home_appliance_wh_per_hour"]),
)
)
== 2000
), "The sum of 'Haushaltsgeraet_wh_pro_stunde' should be 2000."
), "The sum of 'Home_appliance_wh_per_hour' should be 2000."
print("All tests passed successfully.")