Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
61bd0932
Commit
61bd0932
authored
10 months ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: add update_data to scheduler
parent
9a818d2e
No related branches found
Branches containing commit
No related tags found
1 merge request
!19
Clhp map, license agreement
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/map_handler/update_measurements.py
+5
-0
5 additions, 0 deletions
server/map_handler/update_measurements.py
server/scheduler.py
+9
-1
9 additions, 1 deletion
server/scheduler.py
with
14 additions
and
1 deletion
server/map_handler/update_measurements.py
+
5
−
0
View file @
61bd0932
...
...
@@ -68,6 +68,11 @@ def update_measurements(lake_name: str) -> (int, str):
center_lng
=
round
(
sub_division
[
'
CenLongitude
'
],
4
)
avg_thickness
=
sub_division
[
'
AvgThickness
'
]
# Read from json file
# lakName_sub_div.json
# Add center coord txt file
# Call update function once daily
# Retrieve ice statistics for current subdivision
ice_stats
=
get_raw_dates
(
ice_prognosis_raw_data
(
sub_div_id
=
subdiv_id
,
x
=
center_lat
,
y
=
center_lng
))
...
...
This diff is collapsed.
Click to expand it.
server/scheduler.py
+
9
−
1
View file @
61bd0932
...
...
@@ -2,13 +2,21 @@ import json
import
time
import
schedule
from
map_handler.update_measurements
import
update_measurements_handler
from
server.consts
import
LAKE_RELATIONS_PATH
from
ModelFromNVE.icemodellingscripts.getIceThicknessLakes
import
update_data
from
map_handler.update_measurements
import
update_measurements_handler
def
update_all_measurements
(
lake_names
:
list
):
"""
Loops through all lake names and calls get_measurements() on each lake
"""
for
lake
in
lake_names
:
# NB dates are hard coded to january for demonstration. For deployment, simply remove the date parameters.
from_date
=
"
2024-01-10
"
to_date
=
"
2024-01-20
"
update_data
(
from_date
,
to_date
,
lake_name
=
lake_names
,
sub_divs_folder
=
LAKE_RELATIONS_PATH
+
lake_names
+
'
_centers.txt
'
,
update_all_bboxes
=
True
)
update_measurements_handler
(
None
,
lake
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment