NVE / avalanche_ml

Applying machine learning in the Norwegian Avalanche warning Service
MIT License
2 stars 1 forks source link

Fix Regobs download bug #42

Closed widforss closed 3 years ago

widforss commented 3 years ago

Python variables are scoped by function. This meant that in the loop submitting jobs to the executor the value of the variable "query_copy" would have an unexpected value if the jobs were ever blocked. This would happen after 140 * 50 = 7000 observations, as the executor would be out of workers by then.

Now we create all queries separately and put them in a list, which the jobs can pop from one at a time (lists are thread-safe in Python). This should solve the problem.