Commit d0afd0ed authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Geometry: Fix division by 0 for incline.

Showing with 12 additions and 8 deletions
+12 -8
......@@ -25,7 +25,7 @@ from copy import deepcopy
from operator import itemgetter
from functools import reduce
from tools import flatten, timer, trace
from tools import flatten, timer, trace, logger_exception
from Model.Tools.PamhyrDB import SQLSubModel
......@@ -691,10 +691,14 @@ class Reach(SQLSubModel):
logger.debug(f"+{incline_acc}")
logger.debug(f"-{incline_set}")
return (
reduce(
lambda acc, x: acc + x,
incline_set,
0.0
) / (len(incline_set))
)
try:
return (
reduce(
lambda acc, x: acc + x,
incline_set,
0.0
) / (len(incline_set))
)
except Exception as e:
logger_exception(e)
return 0
Supports Markdown
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