Skip to content

Commit

Permalink
fix: prevent division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Oct 12, 2021
1 parent 1dea7c4 commit bacf8dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion popmon/visualization/utils.py
Expand Up @@ -183,7 +183,7 @@ def render_alert_aggregate_table(feature, data, metrics: List[str], labels: List
colors[metric] = {}
row_max = np.max(data[c1])
for c2, label in enumerate(labels):
a = data[c1][c2] / row_max
a = data[c1][c2] / row_max if row_max and row_max != 0 else 0
if metric.endswith("green"):
rgba = (0, 128, 0, a)
elif metric.endswith("yellow"):
Expand Down

0 comments on commit bacf8dd

Please sign in to comment.