Skip to content
Snippets Groups Projects
Commit 9948f71d authored by hexa-'s avatar hexa-
Browse files

hateful merging of multiple score results

parent 91b9af04
No related branches found
No related tags found
No related merge requests found
Pipeline #22237 passed
......@@ -47,14 +47,23 @@ def fetch_community_json():
if community in ignored_communities:
continue
score = calculate_score(nodelist_urls[community][-1])
# hateful merging of multiple data files
score = {'loss': 0, 'models': {}}
for url in nodelist_urls[community]:
tmp = calculate_score(url)
score['loss'] += tmp['loss']
for model, values in tmp['models'].items():
if model not in score['models'].keys():
score['models'][model] = {'count': 0, 'loss': 0}
score['models'][model]['count'] += values['count']
score['models'][model]['loss'] += values['loss']
print(community + ' has score ' + str(score))
if score['loss'] != 0:
community_scores[community] = score
with open('overview_cache.json', 'w') as file:
json.dump(community_scores, file)
with open('overview_cache.json', 'w') as handle:
json.dump(community_scores, handle)
return community_scores
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment