Added ValueError exception for plan / profile load

parent cf8a560f
......@@ -413,12 +413,16 @@ class SimulationParameters:
# Hecras Mode
elif d['hydraulic_mode'] == 'hecras':
with RASProject(d['hecras_path']) as rp:
plan_name = d['hecras_plan']
rp.set_current_plan(plan_name)
profile_name = d['hecras_profile']
temperature = d['hecras_temperature']
hydraulic_df = rp.hydraulic_model_data(
profile_name, temperature)
try:
plan_name = d['hecras_plan']
rp.set_current_plan(plan_name)
profile_name = d['hecras_profile']
temperature = d['hecras_temperature']
hydraulic_df = rp.hydraulic_model_data(
profile_name, temperature)
except:
raise ValueError(
"Either the HEC-RAS plan or profile is missing or is broken.")
temperature = hydraulic_df['Temp_C'].mean()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment