DurhamARC / ManyFEWS

The Many Flood Early Warning System
GNU General Public License v3.0
7 stars 3 forks source link

Implement checking for data in Run Flood Model function #93

Closed sjmf closed 1 year ago

sjmf commented 1 year ago

Occasionally, the Run Flood Model function is run without the Flood Model Parameters being correctly populated in the database. At present, the task shows "SUCCESS" without actually running anything, as if no parameters are returned from the database at flood_risk.py#L59 then the loop is never entered at flood_risk.py#L78.

We should write a check to be inserted at line 60 when running the flood model, to check that there is river flow data in the DB, and throw an exception if not. Something like:

if not len(params):
    raise Exception("There are no catchment model parameters populated in the database")