Dont show score for tags

This commit is contained in:
Dominik Moritz Roth 2022-11-19 16:28:06 +01:00
parent 9a473edfdc
commit e45423aaa4

View File

@ -824,7 +824,7 @@ def scaleOpinionsByRating(G):
def addScoreToLabels(G): def addScoreToLabels(G):
for n in list(G.nodes): for n in list(G.nodes):
node = G.nodes[n] 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: if 'rating' in node and node['rating'] != None:
node['label'] += " ("+str(node['rating'])+")" node['label'] += " ("+str(node['rating'])+")"
else: else:
@ -833,6 +833,12 @@ def addScoreToLabels(G):
node['score'], node['se']) node['score'], node['se'])
else: else:
node['label'] += " (0±∞)" 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): 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) + \ node['fake_se'] = sum(ses)/(len(ses)**1.2) + \
0.5 + 0.5 * (len(scores) == 2) 0.5 + 0.5 * (len(scores) == 2)
node['score'] = sum( 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: if len(scores) == 2:
node['score'] *= 0.80 node['score'] *= 0.85
node['value'] = 20 + 5 * float(node['score']) node['value'] = 20 + 5 * float(node['score'])
node['label'] += " ({:.2f}±{:.1f})".format(node['score'], node['label'] += " ({:.2f}±{:.1f})".format(node['score'],
node['fake_se']) node['fake_se'])