Merge pull request #13 from samginn/sidaw-interactive

prefer sending definitions with cites
This commit is contained in:
Sida Wang 2017-01-25 13:29:40 -08:00 committed by GitHub
commit 5ba580c58d
1 changed files with 7 additions and 1 deletions

View File

@ -251,7 +251,13 @@ def emit_top_builders():
(citations, citation_score) = compute_citations(subdir)
if len(top_5_builders) < 5 or citation_score > top_5_builders[4][0]:
citations = sorted(citations, key=lambda c: c["cite"], reverse=True)[:5]
# If there are more than 5 citations with cites, only return those
citations_with_cites = [c for c in citations if c["cite"] > 0]
if len(citations_with_cites) >= 5:
citations = citations_with_cites
# Sort them by scorem and return the top 5.
citations = sorted(citations, key=lambda c: c["cite"] + c["self"], reverse=True)[:5]
struct = (uid, citation_score, citations)
if len(top_5_builders) < 5: