NVE / varsomdata

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

Closed widforss closed 4 years ago

widforss commented 4 years ago

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.

widforss commented 4 years ago

@jorgkv Any thoughts?

jorgkv commented 4 years ago

Hei! Sorry for lite respons her! Dette ser veldig bra ut :)

jorgkv commented 4 years ago

🎂