From 99a878193d7b8dfc077d7dedcbcca69788b8f802 Mon Sep 17 00:00:00 2001 From: killian-scalian Date: Fri, 10 Jan 2025 10:55:57 +0100 Subject: [PATCH] area.get_wind_matrix() is just here to check to absence or not of the file --- .../input_converter/src/converter.py | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/andromede/input_converter/src/converter.py b/src/andromede/input_converter/src/converter.py index b3208cd..0b91b73 100644 --- a/src/andromede/input_converter/src/converter.py +++ b/src/andromede/input_converter/src/converter.py @@ -170,28 +170,28 @@ def _convert_wind_to_component_list( for area in areas: try: - if area.get_wind_matrix().any: - series_path = ( - self.study_path - / "input" - / "wind" - / "series" - / f"wind_{area.id}.txt" - ) + area.get_wind_matrix() + series_path = ( + self.study_path + / "input" + / "wind" + / "series" + / f"wind_{area.id}.txt" + ) - components.append( - InputComponent( - id=area.id, - model="wind", - parameters=[ - InputComponentParameter( - name="wind", - type="timeseries", - timeseries=str(series_path), - ) - ], - ) + components.append( + InputComponent( + id=area.id, + model="wind", + parameters=[ + InputComponentParameter( + name="wind", + type="timeseries", + timeseries=str(series_path), + ) + ], ) + ) except FileNotFoundError: pass @@ -204,29 +204,29 @@ def _convert_solar_to_component_list( for area in areas: try: - if area.get_solar_matrix().any: - series_path = ( - self.study_path - / "input" - / "solar" - / "series" - / f"solar_{area.id}.txt" - ) - components.extend( - [ - InputComponent( - id=area.id, - model="solar", - parameters=[ - InputComponentParameter( - name="solar", - type="timeseries", - timeseries=str(series_path), - ) - ], - ) - ] - ) + area.get_solar_matrix() + series_path = ( + self.study_path + / "input" + / "solar" + / "series" + / f"solar_{area.id}.txt" + ) + components.extend( + [ + InputComponent( + id=area.id, + model="solar", + parameters=[ + InputComponentParameter( + name="solar", + type="timeseries", + timeseries=str(series_path), + ) + ], + ) + ] + ) except FileNotFoundError: pass @@ -238,29 +238,29 @@ def _convert_load_to_component_list( components = [] for area in areas: try: - if area.get_load_matrix().any: - series_path = ( - self.study_path - / "input" - / "load" - / "series" - / f"load_{area.id}.txt" - ) - components.extend( - [ - InputComponent( - id=area.id, - model="load", - parameters=[ - InputComponentParameter( - name="load", - type="timeseries", - timeseries=str(series_path), - ) - ], - ) - ] - ) + area.get_load_matrix() + series_path = ( + self.study_path + / "input" + / "load" + / "series" + / f"load_{area.id}.txt" + ) + components.extend( + [ + InputComponent( + id=area.id, + model="load", + parameters=[ + InputComponentParameter( + name="load", + type="timeseries", + timeseries=str(series_path), + ) + ], + ) + ] + ) except FileNotFoundError: pass