From 74232bcab50f7f088b4f6bbd68b6f561dd6857d4 Mon Sep 17 00:00:00 2001 From: salemsd Date: Fri, 7 Feb 2025 15:48:41 +0100 Subject: [PATCH] fix: rebase settings refactor --- src/antares/craft/model/study.py | 2 +- src/antares/craft/service/api_services/renewable_api.py | 2 +- src/antares/craft/service/api_services/thermal_api.py | 5 +---- src/antares/craft/service/base_services.py | 5 ----- src/antares/craft/service/local_services/area_local.py | 2 +- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/antares/craft/model/study.py b/src/antares/craft/model/study.py index 19bc71c9..cd0c8248 100644 --- a/src/antares/craft/model/study.py +++ b/src/antares/craft/model/study.py @@ -41,7 +41,7 @@ from antares.craft.model.settings.study_settings import StudySettings from antares.craft.model.simulation import AntaresSimulationParameters, Job from antares.craft.service.api_services.services.settings import read_study_settings_api -from antares.craft.service.base_services import BaseStudyService +from antares.craft.service.base_services import BaseStudyService, BaseLinkService from antares.craft.service.local_services.services.settings import edit_study_settings, read_study_settings_local from antares.craft.service.service_factory import ServiceFactory from antares.craft.tools.ini_tool import IniFile, InitializationFilesTypes diff --git a/src/antares/craft/service/api_services/renewable_api.py b/src/antares/craft/service/api_services/renewable_api.py index fe5b6c18..4ebfa8e0 100644 --- a/src/antares/craft/service/api_services/renewable_api.py +++ b/src/antares/craft/service/api_services/renewable_api.py @@ -104,7 +104,7 @@ def read_renewables( renewable_name = renewable.pop("name") renewable_props = RenewableClusterProperties(**renewable) - renewable_cluster = RenewableCluster(self.config, renewable_id, renewable_name, renewable_props) + renewable_cluster = RenewableCluster(self, renewable_id, renewable_name, renewable_props) renewables.append(renewable_cluster) renewables.sort(key=lambda renewable: renewable.id) diff --git a/src/antares/craft/service/api_services/thermal_api.py b/src/antares/craft/service/api_services/thermal_api.py index 26c2f2e7..3fbc7119 100644 --- a/src/antares/craft/service/api_services/thermal_api.py +++ b/src/antares/craft/service/api_services/thermal_api.py @@ -106,7 +106,4 @@ def read_thermal_clusters( thermals.sort(key=lambda thermal: thermal.id) - return thermals - - def _extract_thermal_properties(self, thermal_data: dict[str, Any]) -> ThermalClusterProperties: - pass + return thermals \ No newline at end of file diff --git a/src/antares/craft/service/base_services.py b/src/antares/craft/service/base_services.py index 1a03c6c5..3956d682 100644 --- a/src/antares/craft/service/base_services.py +++ b/src/antares/craft/service/base_services.py @@ -463,11 +463,6 @@ def get_thermal_matrix(self, thermal_cluster: ThermalCluster, ts_name: ThermalCl def read_thermal_clusters(self, area_id: str) -> List[ThermalCluster]: pass - @abstractmethod - def _extract_thermal_properties(self, thermal_data: dict[str, Any]) -> ThermalClusterProperties: - pass - - class BaseBindingConstraintService(ABC): binding_constraints: dict[str, BindingConstraint] diff --git a/src/antares/craft/service/local_services/area_local.py b/src/antares/craft/service/local_services/area_local.py index b543c727..1f4dcc72 100644 --- a/src/antares/craft/service/local_services/area_local.py +++ b/src/antares/craft/service/local_services/area_local.py @@ -203,7 +203,7 @@ def create_hydro( IniFile.create_hydro_initialization_files_for_area(self.config.study_path, area_id) - return Hydro(self, area_id, local_hydro_properties.yield_hydro_properties()) + return Hydro(self.hydro_service, area_id, local_hydro_properties.yield_hydro_properties()) def read_hydro( self,