Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
killian-scalian committed Dec 20, 2024
1 parent f954e69 commit ff29254
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 39 deletions.
57 changes: 20 additions & 37 deletions src/andromede/input_converter/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from andromede.study.parsing import (
InputComponent,
InputComponentParameter,
InputComponents,
)


Expand All @@ -23,61 +22,45 @@ def convert_area_to_component_list(areas: list[Area]) -> list[InputComponent]:
return [InputComponent(id=area.id, model="area") for area in areas]


def convert_renewable_to_component_list(area: Area) -> list[InputComponent]:
renewables = area.read_renewables()
return [
InputComponent(
id=renewable.id,
model="renewable",
parameters=[
InputComponentParameter(
name="unit_count",
type="constant",
value=renewable.properties.unit_count,
),
InputComponentParameter(
name="nominal_capacity",
type="constant",
value=renewable.properties.nominal_capacity,
),
InputComponentParameter(
name=renewable.id,
type="timeseries",
timeseries=str(renewable.get_timeseries()),
),
],
)
for renewable in renewables
]


def convert_hydro_to_component_list(area: Area) -> list[InputComponent]:
def convert_renewable_to_component_list(areas: list[Area]) -> list[InputComponent]:
raise NotImplementedError


def convert_st_storages_to_component_list(area: Area) -> list[InputComponent]:
def convert_hydro_to_component_list(area: Area) -> list[InputComponent]:
raise NotImplementedError


def convert_thermals_to_component_list(area: Area) -> list[InputComponent]:
def convert_thermals_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError


def convert_load_matrix_to_component_list(area: Area) -> list[InputComponent]:
def convert_load_matrix_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError


def convert_misc_gen_to_component_list(area: Area) -> list[InputComponent]:
def convert_misc_gen_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError


def convert_reserves_matrix_to_component_list(area: Area) -> list[InputComponent]:
def convert_reserves_matrix_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError


def convert_wind_matrix_to_component_list(area: Area) -> list[InputComponent]:
def convert_wind_matrix_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError


def convert_solar_matrix_to_component_list(area: Area) -> list[InputComponent]:
def convert_solar_matrix_to_component_list(
areas: list[Area], root_path: Path
) -> list[InputComponent]:
raise NotImplementedError
5 changes: 3 additions & 2 deletions tests/input_converter/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def test_convert_area_to_input_components(self, local_study_w_areas):
components=[],
connections=[],
)
# We add a sort because we want to check only presence and validity of area_components node.
# Not position
#To ensure that the comparison between the actual and expected results is not affected by the order of the nodes,
# both the area_components.nodes and expected_area_components.nodes lists are sorted by the id attribute of each node.
# This sorting step ensures that the test checks only the presence and validity of the nodes, not their order.
area_components.nodes.sort(key=lambda x: x.id)
expected_area_components.nodes.sort(key=lambda x: x.id)

Expand Down

0 comments on commit ff29254

Please sign in to comment.