From 1d88fa98640c5acf9a8a82fa46967983512129cb Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 13 May 2024 02:39:05 -0500 Subject: [PATCH] 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. --- scripts/code.py | 3 +-- scripts/cov.py | 3 +-- scripts/data.py | 3 +-- scripts/perf.py | 3 +-- scripts/perfbd.py | 3 +-- scripts/stack.py | 3 +-- scripts/structs.py | 3 +-- scripts/summary.py | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index 43f032a2..2327bdbe 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -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 diff --git a/scripts/cov.py b/scripts/cov.py index 8fa9a3d3..0ae5f60e 100755 --- a/scripts/cov.py +++ b/scripts/cov.py @@ -447,8 +447,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 diff --git a/scripts/data.py b/scripts/data.py index b8d2f66f..c4243755 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -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 diff --git a/scripts/perf.py b/scripts/perf.py index 0dd4def4..bcc4d347 100755 --- a/scripts/perf.py +++ b/scripts/perf.py @@ -787,8 +787,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 diff --git a/scripts/perfbd.py b/scripts/perfbd.py index c99ca3a6..a29fd141 100755 --- a/scripts/perfbd.py +++ b/scripts/perfbd.py @@ -753,8 +753,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 diff --git a/scripts/stack.py b/scripts/stack.py index 4ee2d3f4..06228ac3 100755 --- a/scripts/stack.py +++ b/scripts/stack.py @@ -424,8 +424,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 diff --git a/scripts/structs.py b/scripts/structs.py index efe90326..9b32724e 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -414,8 +414,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 diff --git a/scripts/summary.py b/scripts/summary.py index 5694d6dc..b5eb606f 100755 --- a/scripts/summary.py +++ b/scripts/summary.py @@ -542,8 +542,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