Skip to content

Commit

Permalink
Merge branch 'fix/pingmatrix_div_by_zero' into ci/arcus-basic
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpb committed May 11, 2022
2 parents dfc96ea + 157d778 commit baea143
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ansible/roles/hpctests/library/plot_nxnlatbw.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def html_rows(rankAs, rankBs, nodes, data):
for rankB in rankBs:
val = data.get((rankA, rankB))
if val is not None:
lightness = 50 + (50 - 50 * ((val - minv) / (maxv - minv))) # want value in range LOW = 100 (white) -> HIGH 50(red)
try:
lightness = 50 + (50 - 50 * ((val - minv) / (maxv - minv))) # want value in range LOW = 100 (white) -> HIGH 50(red)
except ZeroDivisionError: # no min-max spread
lighness = 100
outrow += ['<td style="background-color:hsl(0, 100%%, %i%%);">%.1f</td>' % (lightness, val)]
else:
outrow += ['<td>-</td>']
Expand Down

0 comments on commit baea143

Please sign in to comment.