From 169952dec0355ff7ac37136fecfe97da2a64e3b9 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 2 Jun 2024 14:57:32 -0500 Subject: [PATCH] =?UTF-8?q?Tweaked=20scripts=20to=20render=20new=20entry?= =?UTF-8?q?=20ratios=20as=20+=E2=88=9E%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already rely on this symbol in these scripts, so might use it to display the mathematically correct ratio for new entries. This has the added benefit of ordering new entries vs extremely big changes correctly: $ ./scripts/code.py -u test.after.csv -d test.before.csv function (1 added, 0 removed) osize nsize dsize test_a - 49 +49 (+∞%) test_b 19 719 +700 (+3684.2%) test_c 91 191 +100 (+109.9%) TOTAL 110 959 +849 (+771.8%) --- scripts/code.py | 2 +- scripts/cov.py | 2 +- scripts/data.py | 2 +- scripts/perf.py | 2 +- scripts/perfbd.py | 2 +- scripts/stack.py | 2 +- scripts/structs.py | 2 +- scripts/summary.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index bd49c5ea..e18961de 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -90,7 +90,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/cov.py b/scripts/cov.py index 232e2d40..7cfbf3e6 100755 --- a/scripts/cov.py +++ b/scripts/cov.py @@ -90,7 +90,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/data.py b/scripts/data.py index 245cb88c..cd79a12c 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -90,7 +90,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/perf.py b/scripts/perf.py index a33d76c1..15e607e1 100755 --- a/scripts/perf.py +++ b/scripts/perf.py @@ -99,7 +99,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/perfbd.py b/scripts/perfbd.py index 1fc167fd..2d05914a 100755 --- a/scripts/perfbd.py +++ b/scripts/perfbd.py @@ -90,7 +90,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/stack.py b/scripts/stack.py index b4089847..faa459d8 100755 --- a/scripts/stack.py +++ b/scripts/stack.py @@ -81,7 +81,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/structs.py b/scripts/structs.py index 3d1a2129..aa91cb7c 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -86,7 +86,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old diff --git a/scripts/summary.py b/scripts/summary.py index 2b1a0c8a..e65347f8 100755 --- a/scripts/summary.py +++ b/scripts/summary.py @@ -106,7 +106,7 @@ class RInt(co.namedtuple('RInt', 'x')): elif not old and not new: return 0.0 elif not old: - return 1.0 + return +m.inf else: return (new-old) / old