autopilot: fixme division by zero

I don't understand the code at that location, but it can raise
a division by zero in testing environment where no real graph
was accessible because it couldn't be downloaded.
This commit is contained in:
Michael Schmoock
2022-02-21 15:18:52 +01:00
parent 00ebb60a1b
commit 225b4ca9b7

View File

@@ -243,6 +243,7 @@ class Autopilot():
path_pdf[node] = path_sum
s = sum(path_pdf.values())
# FIXME: next line can raise a division by zero
path_pdf = {k: v / s for k, v in path_pdf.items()}
self.__logger.info(
"DECREASE DIAMETER: probability density function created")