Skip to content

Commit

Permalink
reformatting files and correcting minor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdiwahada committed Nov 8, 2024
1 parent 5e45bbf commit 71e5df5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/antares/service/api_services/area_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,15 @@ def get_load_matrix(self, area: Area) -> pd.DataFrame:
except APIError as e:
raise LoadMatrixDownloadError(area.id, e.message) from e

def craft_ui(self, url_str: str, area_id: str) -> AreaUi:
response = self._wrapper.get(url_str)
json_ui = response.json()[area_id]

ui_response = AreaUiResponse.model_validate(json_ui)
current_ui = AreaUi.model_validate(ui_response.to_craft())

return current_ui

def read_areas(self) -> List[Area]:
area_list = []

Expand Down Expand Up @@ -607,13 +616,3 @@ def read_areas(self) -> List[Area]:
area_list.append(area_obj)

return area_list


def craft_ui(self, url_str: str, area_id: str) -> AreaUi:
response = self._wrapper.get(url_str)
json_ui = response.json()[area_id]

ui_response = AreaUiResponse.model_validate(json_ui)
current_ui = AreaUi.model_validate(ui_response.to_craft())

return current_ui

0 comments on commit 71e5df5

Please sign in to comment.