Skip to content

Commit

Permalink
GSYE-660: Fix home count
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesdiedrich committed Nov 23, 2023
1 parent 2ba193e commit 6733037
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gsy_framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ class HomeRepresentationUtils:

@staticmethod
def _is_home(representation):
home_devices = ["PV", "Storage", "Load", "MarketMaker"]
home_devices = ["PV", "Storage", "Load", "MarketMaker", "HeatPump", "WindTurbine",
"SmartMeter"]
return all("type" in c and c["type"] in home_devices
for c in representation["children"])

Expand Down
22 changes: 20 additions & 2 deletions tests/test_assets_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ def test_update_from_repr(self):
"type": "Storage",
"battery_capacity_kWh": 20
},
{
"type": "Area",
"children":
[
{
"type": "HeatPump"
},
]
},
{
"type": "Area",
"children":
[
{
"type": "SmartMeter"
},
]
},
{
"type": "Area",
"children":
Expand Down Expand Up @@ -121,8 +139,8 @@ def test_update_from_repr(self):
"total_energy_capacity_kwh": 45,
"number_of_power_plant_type": 2,
"max_power_plant_power_kw": 45,
"number_of_house_type": 2,
"avg_assets_per_house": 3
"number_of_house_type": 4,
"avg_assets_per_house": 2
}
actual_res = {key: self.assets_info.raw_results[key] for key in expected_res}
assert expected_res == actual_res

0 comments on commit 6733037

Please sign in to comment.