Skip to content

Commit

Permalink
feat(api) : working on read_hydro_matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdiwahada committed Jan 10, 2025
1 parent b0c1045 commit 0b7ba89
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/antares/craft/model/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,18 @@ def read_hydro(
self,
) -> Hydro:
return self._area_service.read_hydro(self.id)

def get_maxpower(self) -> pd.DataFrame:
return self._area_service.get_reservoir()

def get_reservoir(self) -> pd.DataFrame:
return self._area_service.get_reservoir()

def get_inflow_pattern(self) -> pd.DataFrame:
return self._area_service.get_inflow_pattern()

def get_credit_modulations(self) -> pd.DataFrame:
return self._area_service.get_credit_modulations()

def get_water_values(self) -> pd.DataFrame:
return self._area_service.get_water_values()
15 changes: 15 additions & 0 deletions src/antares/craft/service/api_services/area_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,18 @@ def read_areas(self) -> List[Area]:
# sort area list to ensure reproducibility
area_list.sort(key=lambda area: area.id)
return area_list

def get_maxpower(self) -> pd.DataFrame:
raise NotImplementedError

def get_reservoir(self) -> pd.DataFrame:
raise NotImplementedError

def get_inflow_pattern(self) -> pd.DataFrame:
raise NotImplementedError

def get_water_values(self) -> pd.DataFrame:
raise NotImplementedError

def get_credit_modulations(self) -> pd.DataFrame:
raise NotImplementedError
20 changes: 20 additions & 0 deletions src/antares/craft/service/base_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,26 @@ def read_areas(self) -> list[Area]:
"""
pass

@abstractmethod
def get_maxpower(self) -> pd.DataFrame:
pass

@abstractmethod
def get_reservoir(self) -> pd.DataFrame:
pass

@abstractmethod
def get_inflow_pattern(self) -> pd.DataFrame:
pass

@abstractmethod
def get_credit_modulations(self) -> pd.DataFrame:
pass

@abstractmethod
def get_water_values(self) -> pd.DataFrame:
pass


class BaseLinkService(ABC):
@abstractmethod
Expand Down
15 changes: 15 additions & 0 deletions src/antares/craft/service/local_services/area_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,18 @@ def read_areas(self) -> List[Area]:
)
)
return areas

def get_maxpower(self) -> pd.DataFrame:
raise NotImplementedError

def get_reservoir(self) -> pd.DataFrame:
raise NotImplementedError

def get_inflow_pattern(self) -> pd.DataFrame:
raise NotImplementedError

def get_water_values(self) -> pd.DataFrame:
raise NotImplementedError

def get_credit_modulations(self) -> pd.DataFrame:
raise NotImplementedError

0 comments on commit 0b7ba89

Please sign in to comment.