diff --git a/src/andromede/input_converter/src/utils.py b/src/andromede/input_converter/src/utils.py index 788e574..bd8e015 100644 --- a/src/andromede/input_converter/src/utils.py +++ b/src/andromede/input_converter/src/utils.py @@ -6,7 +6,6 @@ from andromede.study.parsing import ( InputComponent, InputComponentParameter, - InputComponents, ) @@ -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 diff --git a/tests/input_converter/test_converter.py b/tests/input_converter/test_converter.py index 2e88646..2bfc758 100644 --- a/tests/input_converter/test_converter.py +++ b/tests/input_converter/test_converter.py @@ -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)