mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-26 01:14:20 +01:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user