From 87b965188a065443f1536971ea1018f093064060 Mon Sep 17 00:00:00 2001 From: TerjeKir <42723273+TerjeKir@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:43:10 +0200 Subject: [PATCH] Show llr bounds only if they are not default (#81) * only show llr bounds if they are not the default (2.94) * twoDig returns strings --- OpenBench/templatetags/mytags.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py index ce41a3d..db48ec2 100644 --- a/OpenBench/templatetags/mytags.py +++ b/OpenBench/templatetags/mytags.py @@ -64,13 +64,18 @@ def gitDiffLink(test): def shortStatBlock(test): - lowerllr = twoDigitPrecision(test.lowerllr) currentllr = twoDigitPrecision(test.currentllr) + lowerllr = twoDigitPrecision(test.lowerllr) upperllr = twoDigitPrecision(test.upperllr) elolower = twoDigitPrecision(test.elolower) eloupper = twoDigitPrecision(test.eloupper) - return 'LLR: {0} ({1}, {2}) [{3}, {4}]\n'.format(currentllr, lowerllr, upperllr, elolower, eloupper) \ + if upperllr != '2.94' or lowerllr != '2.94': + llrbounds = '({1}, {2}) '.format(lowerllr, upperllr) + else: + llrbounds = '' + + return 'LLR: {0} {1}[{2}, {3}]\n'.format(currentllr, llrbounds, elolower, eloupper) \ + 'Games: {0} W: {1} L: {2} D: {3}'.format(test.games, test.wins, test.losses, test.draws) def longStatBlock(test):