Repository contains methods and modules for accessing api's for regObs, The forecasting-api and The chart server which provides charts to seNorge and xGeo. All these products are a part of the Varsom-family; products used in forecasting at NVE.
MIT License
2
stars
1
forks
source link
Parallelizing get_all_forecasts speeds up download #1
This uses concurrent.futures to make the download concurrent.
It still just downloads one region at a time, but now it also only
downloads 31 days per API call. This is because the API gets
really slow when a whole season is requested at once.
The error handling is also modified to better accomodate the async
model. Since it is now handled iteratively, the parameter
name recursive_count is not technically correct, but I did not want to
change the function API.
get_avalanche_warnings_as_json() will return the bulletins out of order
but all users of this function seems to sort the list. Therefore, this
should not matter.
This uses concurrent.futures to make the download concurrent. It still just downloads one region at a time, but now it also only downloads 31 days per API call. This is because the API gets really slow when a whole season is requested at once.
The error handling is also modified to better accomodate the async model. Since it is now handled iteratively, the parameter name recursive_count is not technically correct, but I did not want to change the function API.
get_avalanche_warnings_as_json() will return the bulletins out of order but all users of this function seems to sort the list. Therefore, this should not matter.