In scripts -d/--diff, show either all percentages or none

Previously, with -d/--diff, we would only show non-zero percentages. But
this was ambiguous/confusing when dealing with multiple results
(stack.py, summary.py, etc).

To help with this, I've switched to showing all percentages unless all
percentages are zero (no change). This matches the -d/--diff row-hiding
logic, so by default all rows should show all percentages.

Note -p/--percent did not change, as it already showed all percentages
all of the time.
This commit is contained in:
Christopher Haster
2024-05-13 02:39:05 -05:00
parent 7a7da9680a
commit 1d88fa9864
8 changed files with 8 additions and 16 deletions

View File

@@ -465,8 +465,7 @@ def table(Result, results, diff_results=None, *,
'+∞%' if t == +m.inf
else '-∞%' if t == -m.inf
else '%+.1f%%' % (100*t)
for t in ratios
if t)
for t in ratios)
if any(ratios) else '')
return entry