From e45423aaa43e81abb12f7627ebf380c20f3bf461 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 19 Nov 2022 16:28:06 +0100 Subject: [PATCH] Dont show score for tags --- caliGraph.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/caliGraph.py b/caliGraph.py index 4a148dc..42e61e3 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -824,7 +824,7 @@ def scaleOpinionsByRating(G): def addScoreToLabels(G): for n in list(G.nodes): node = G.nodes[n] - if node['t'] not in []: #['tag', 'newBook']: + if node['t'] not in ['tag', 'newBook']: if 'rating' in node and node['rating'] != None: node['label'] += " ("+str(node['rating'])+")" else: @@ -833,6 +833,12 @@ def addScoreToLabels(G): node['score'], node['se']) else: node['label'] += " (0±∞)" + if False node['t'] in ['tag']: + if 'score' in node and node['score'] != None and 'se' in node: + node['label'] += " ({:.1f})".format( + node['score']) + else: + node['label'] += " (0)" def genAndShowHTML(G, showButtons=False, darkMode=False, arrows=False): @@ -1344,9 +1350,9 @@ def findNewBooks(G, books, mu, num=-1, minRecSco=5): node['fake_se'] = sum(ses)/(len(ses)**1.2) + \ 0.5 + 0.5 * (len(scores) == 2) node['score'] = sum( - scores)/len(scores)*1.2 - node['fake_se']*1.6 + 0.5 - 0.1/math.sqrt(len(scores)) + scores)/len(scores)*1.2 - node['fake_se']*1.4 + 0.5 - 0.1/math.sqrt(len(scores)) if len(scores) == 2: - node['score'] *= 0.80 + node['score'] *= 0.85 node['value'] = 20 + 5 * float(node['score']) node['label'] += " ({:.2f}±{:.1f})".format(node['score'], node['fake_se'])