From 83a4f61577fb239a49ac939432934ff72275c229 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Tue, 14 May 2024 17:28:11 +0200 Subject: [PATCH] update: revert ice stats retrieval, update docstrings --- app/lib/widgets/main_layout.dart | 2 +- server/map_handler/add_new_lake.py | 4 +++- server/map_handler/get_lake_relation.py | 2 ++ server/map_handler/update_measurements.py | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/lib/widgets/main_layout.dart b/app/lib/widgets/main_layout.dart index 1d20c1e6..e26e1255 100644 --- a/app/lib/widgets/main_layout.dart +++ b/app/lib/widgets/main_layout.dart @@ -269,7 +269,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ), ), ), - Positioned( // Color info button + Positioned( // Color info layer button top: 170, right: 10, child: GestureDetector( diff --git a/server/map_handler/add_new_lake.py b/server/map_handler/add_new_lake.py index 4f57b409..b94b87a3 100644 --- a/server/map_handler/add_new_lake.py +++ b/server/map_handler/add_new_lake.py @@ -30,6 +30,8 @@ def cut_map(cursor, lake_name: str, cell_size_in_km: float = 0.5) -> (int, str): cursor (cursor): An Sqlite3 cursor object that points to the database lake_name (str): The name of the lake to be cut cell_size_in_km (float): The selected cell size in kilometers + Returns: + (int, str): A HTTP status code and the updated data """ try: # Read relation from GeoJson file and extract all geometry of type Polygon @@ -137,7 +139,7 @@ def cut_map(cursor, lake_name: str, cell_size_in_km: float = 0.5) -> (int, str): return 500, f"Error in adding new map: {e}" -def create_grid(poly: Polygon, cell_width: float, cell_height: float): +def create_grid(poly: Polygon, cell_width: float, cell_height: float) -> list: """ Returns a list of vertical and horizontal LineStrings that create a grid. diff --git a/server/map_handler/get_lake_relation.py b/server/map_handler/get_lake_relation.py index f54746e1..024f47da 100644 --- a/server/map_handler/get_lake_relation.py +++ b/server/map_handler/get_lake_relation.py @@ -20,6 +20,8 @@ def fetch_data(file_name: str, measurement: bool) -> (int, str): Parameters: file_name (str): The name of the requested file/lake measurement (bool): Whether the file is of type _measurements.json or _div.json + Returns: + (int, str): A HTTP status code and the requested data """ try: if measurement: diff --git a/server/map_handler/update_measurements.py b/server/map_handler/update_measurements.py index cda26653..53a9a3f3 100644 --- a/server/map_handler/update_measurements.py +++ b/server/map_handler/update_measurements.py @@ -22,6 +22,8 @@ def update_measurements(lake_name: str) -> (int, str): Parameters: lake_name (str): The name of the requested lake + Returns: + (int, str): A HTTP status code and the updated data """ try: # Return immediately if an invalid lake name was provided @@ -155,7 +157,6 @@ def fill_remaining_subdivisions(lake_name: str, processed_ids: list, all_ice_sta Parameters: lake_name (str): The name of the requested file/lake processed_ids (list): List of ids (int) of all subdivisions that have already been processed - Returns: sub_divisions (list): A list of subdivision dictionaries """ -- GitLab