diff --git a/src/antares/service/api_services/renewable_api.py b/src/antares/service/api_services/renewable_api.py index 79f530f5..5ad85fba 100644 --- a/src/antares/service/api_services/renewable_api.py +++ b/src/antares/service/api_services/renewable_api.py @@ -51,19 +51,19 @@ def update_renewable_properties( return new_properties - def get_renewable_matrix(self, renewable_id: str, area_id: str) -> pd.DataFrame: + def get_renewable_matrix(self, cluster_id: str, area_id: str) -> pd.DataFrame: try: path = ( PurePosixPath("input") / "renewables" / "series" / f"{area_id}" - / f"{renewable_id}" + / f"{cluster_id}" / "series" ) return get_matrix(f"{self._base_url}/studies/{self.study_id}/raw?path={path}", self._wrapper) except APIError as e: - raise RenewableMatrixDownloadError(area_id, renewable_id, e.message) from e + raise RenewableMatrixDownloadError(area_id, cluster_id, e.message) from e def read_renewables( self, diff --git a/src/antares/service/base_services.py b/src/antares/service/base_services.py index 8514c907..c552828c 100644 --- a/src/antares/service/base_services.py +++ b/src/antares/service/base_services.py @@ -522,12 +522,12 @@ def update_renewable_properties( @abstractmethod def get_renewable_matrix( - self, renewable_id: str, area_id: str + self, cluster_id: str, area_id: str ) -> pd.DataFrame: """ Args: - renewable: renewable cluster to retrieve matrix - + cluster_id: renewable cluster id to retrieve matrix + area_id: area id to retrieve matrix Returns: matrix requested """ diff --git a/src/antares/service/local_services/renewable_local.py b/src/antares/service/local_services/renewable_local.py index 164e8a82..9e8b3001 100644 --- a/src/antares/service/local_services/renewable_local.py +++ b/src/antares/service/local_services/renewable_local.py @@ -37,10 +37,10 @@ def update_renewable_properties( def get_renewable_matrix( self, - renewable_id: str, + cluster_id: str, area_id: str ) -> pd.DataFrame: - return read_timeseries(TimeSeriesFileType.RENEWABLE_DATA_SERIES, self.config.study_path, area_id=area_id, renewable_id=renewable_id) + return read_timeseries(TimeSeriesFileType.RENEWABLE_DATA_SERIES, self.config.study_path, area_id=area_id, cluster_id=cluster_id) def read_renewables(self, area_id: str) -> List[RenewableCluster]: diff --git a/src/antares/tools/matrix_tool.py b/src/antares/tools/matrix_tool.py index 2bbe462d..634a4504 100644 --- a/src/antares/tools/matrix_tool.py +++ b/src/antares/tools/matrix_tool.py @@ -42,11 +42,11 @@ def df_read(path: Path) -> pd.DataFrame: return pd.read_csv(path, sep="\t", header=None) -def read_timeseries(ts_file_type: TimeSeriesFileType, study_path: Path, area_id: Optional[str] = None, constraint_id: Optional[str] = None, renewable_id: Optional[str] = None,) -> pd.DataFrame: +def read_timeseries(ts_file_type: TimeSeriesFileType, study_path: Path, area_id: Optional[str] = None, constraint_id: Optional[str] = None, cluster_id: Optional[str] = None,) -> pd.DataFrame: file_path = study_path / ( ts_file_type.value - if not (area_id or constraint_id or renewable_id) - else ts_file_type.value.format(area_id=area_id, constraint_id=constraint_id, renewable_id=renewable_id) + if not (area_id or constraint_id or cluster_id) + else ts_file_type.value.format(area_id=area_id, constraint_id=constraint_id, cluster_id=cluster_id) ) if os.path.getsize(file_path) != 0: _time_series = df_read(file_path) diff --git a/src/antares/tools/time_series_tool.py b/src/antares/tools/time_series_tool.py index 007e3d0a..fe737535 100644 --- a/src/antares/tools/time_series_tool.py +++ b/src/antares/tools/time_series_tool.py @@ -48,7 +48,7 @@ class TimeSeriesFileType(Enum): WIND_DATA = "input/wind/prepro/{area_id}/data.txt" WIND_K = "input/wind/prepro/{area_id}/k.txt" WIND_TRANSLATION = "input/wind/prepro/{area_id}/translation.txt" - RENEWABLE_DATA_SERIES = "input/renewables/series/{area_id}/{renewable_id}/series.txt" + RENEWABLE_DATA_SERIES = "input/renewables/series/{area_id}/{cluster_id}/series.txt" class TimeSeries: