Skip to content

Commit

Permalink
Merge pull request #36 from ehenneken/papernetwork_bug
Browse files Browse the repository at this point in the history
round() fix
  • Loading branch information
ehenneken authored Dec 15, 2021
2 parents a28cddc + 19e39c5 commit e527925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vis_services/lib/paper_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def get_papernetwork(solr_data, max_groups, weighted=True, equalization=False, d
scale = sqrt(len(reference_dictionary[papers[i]])*len(reference_dictionary[papers[j]]))
force = 100*C[ref_papers.get(papers[i]),ref_papers.get(papers[j])] / scale
if force > 0:
link_dict["%s\t%s"%(papers[i],papers[j])] = int(round(force))
link_dict["%s\t%s"%(papers[j],papers[i])] = int(round(force))
link_dict["%s\t%s"%(papers[i],papers[j])] = math.floor(force+.5)
link_dict["%s\t%s"%(papers[j],papers[i])] = math.floor(force+.5)
# Cut the list of links to the maximum allowed by first sorting by force strength and then cutting by maximum allowed
if do_cutoff:
link_dict = _sort_and_cut_results(link_dict)
Expand Down

0 comments on commit e527925

Please sign in to comment.