Skip to content
Snippets Groups Projects
Commit c91759b5 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: var names and add unit test folder

parent f2d90fc5
No related branches found
No related tags found
1 merge request!16Clhp map into main
......@@ -98,7 +98,7 @@ def cut_map(self, cursor, lake_name: str, cell_size_in_km: float = 0.5):
'features': features
}
# Add lake name to database
# Check if the name exists in the database
cursor.execute('''
SELECT Name FROM BodyOfWater WHERE Name = ?;
''', (lake_name,))
......@@ -195,8 +195,8 @@ def write_json_to_file(lake_name: str, map_data: dict):
# Plotting the map can take a considerable amount of time, especially when creating maps with many
# subdivisions. Removing calls to plot_map will speed up the process, but it is recommended to plot the map
# after each division to ensure that the map was divided as intended.
# subdivisions. Removing calls to plot_map will speed up the process, but it is highly recommended
# to plot the map after each division to ensure that the map was divided as intended.
def plot_map(divided_map):
"""
Plots a divided map using matplotlib.
......
from server.map_handler.add_new_lake import create_grid
#def tes_create_grid_default():
#grid = create_grid(0.2, 0.3)
#assert
\ No newline at end of file
......@@ -55,9 +55,6 @@ def update_measurements(self, lake_name: str):
avg_thickness = sub_division['AvgThickness']
# Retrieve ice statistics for current subdivision
temp_to_date = "2024-10-12"
temp_from_date = "2024-10-19"
#ice_stats = get_raw_dates(ice_prognosis_raw_data(sub_div_id=subdiv_id, x=center_lat, y=center_lng), to_date=temp_to_date,from_date=temp_from_date)
ice_stats = get_raw_dates(ice_prognosis_raw_data(sub_div_id=subdiv_id, x=center_lat, y=center_lng))
# Ice statistics were retrieved successfully
......@@ -169,9 +166,6 @@ def fill_remaining_subdivisions(lake_name: str, processed_ids: list):
center_lng = round(sub_div['properties']['sub_div_center'][1], 4)
# Fetch weather data for each subdivision from the NVE model
# NB hard coded date to december 2024 for testing, remove to_date param before use
# temp_to_date = "2024-10-12"
# temp_from_date = "2024-10-19"
ice_stats = get_raw_dates(ice_prognosis_raw_data(sub_div_id=sub_div_id, x=center_lat, y=center_lng))
if len(ice_stats) > 0 and len(ice_stats[0]) > 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment