Skip to content

Commit

Permalink
Basics of thermal cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigurd-Borge committed Dec 6, 2024
1 parent 79b5c73 commit a75ddfe
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/integration/test_local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from antares.model.commons import FilterOption
from antares.model.link import Link, LinkProperties, LinkUi
from antares.model.study import Study
from antares.model.thermal import ThermalCluster
from antares.model.thermal import ThermalCluster, ThermalClusterGroup, ThermalClusterProperties
from antares.tools.ini_tool import IniFile, IniFileTypes
from antares.tools.time_series_tool import TimeSeriesFileType

Expand Down Expand Up @@ -165,3 +165,22 @@ def test_local_study(self, tmp_path, other_area):
# asserts study contains all links and areas
assert test_study.get_areas() == {at.id: at, area_be.id: area_be, fr.id: fr, area_de.id: area_de}
assert test_study.get_links() == {at_fr.name: at_fr, link_be_fr.name: link_be_fr, link_de_fr.name: link_de_fr}

# test thermal cluster creation with default values
thermal_name = "Cluster_test %?"
with pytest.raises(InvalidNameError):
fr.create_thermal_cluster(thermal_name)

thermal_name = "Cluster_test"
thermal_fr = fr.create_thermal_cluster(thermal_name)

assert thermal_fr.id == "cluster_test"

# test thermal cluster creation with properties
thermal_name = "gaz_be"
thermal_properties = ThermalClusterProperties(efficiency=55)
thermal_properties.group = ThermalClusterGroup.GAS
thermal_be = area_be.create_thermal_cluster(thermal_name, thermal_properties)
properties = thermal_be.properties
assert properties.efficiency == 55
assert properties.group == ThermalClusterGroup.GAS

0 comments on commit a75ddfe

Please sign in to comment.