EmmaScharfmannBerkeley commited on
Commit
d3bc946
·
1 Parent(s): 7406800

Update Climate_site/python_scripts/paper_functions_own_details.py

Browse files
Climate_site/python_scripts/paper_functions_own_details.py CHANGED
@@ -435,7 +435,7 @@ def main_authors( research_key_words , details , size):
435
 
436
  dic_papers_co_authors = {}
437
 
438
- for paper in list(dic_papers_ranked.keys()):
439
 
440
  for k in range(len(dic_papers[paper]["authorships"])):
441
  coauthor_id = dic_papers[paper]["authorships"][k]["author"]["id"]
@@ -454,10 +454,10 @@ def main_authors( research_key_words , details , size):
454
  dic_papers_co_authors[author_name_norm]["Author's id(s)"] = coauthor_id[21:]
455
  else:
456
  dic_papers_co_authors[author_name_norm]["Author's id(s)"] = ""
457
- dic_papers_co_authors[author_name_norm]["Number of occurence within the " + str(200) + " most related papers"] = 1
458
  dic_papers_co_authors[author_name_norm]["Number of related citations"] = dic_papers[paper]["cited_by_count"]
459
  else:
460
- dic_papers_co_authors[author_name_norm]["Number of occurence within the " + str(200) + " most related papers"] += 1
461
  if author_name not in dic_papers_co_authors[author_name_norm]["Author's name(s)"]:
462
  dic_papers_co_authors[author_name_norm]["Author's name(s)"] += ", " + author_name
463
  if coauthor_id != None and coauthor_id[21:] not in dic_papers_co_authors[author_name_norm]["Author's id(s)"]:
@@ -505,7 +505,7 @@ def main_authors( research_key_words , details , size):
505
 
506
 
507
 
508
- dic_papers_co_authors = {k: v for k, v in sorted(dic_papers_co_authors.items(), key=lambda item: item[1]["Number of occurence within the " + str(200) + " most related papers"] , reverse = True)[:size]}
509
 
510
 
511
  dic_papers_map = {}
 
435
 
436
  dic_papers_co_authors = {}
437
 
438
+ for paper in list(dic_papers_ranked.keys())[:size]:
439
 
440
  for k in range(len(dic_papers[paper]["authorships"])):
441
  coauthor_id = dic_papers[paper]["authorships"][k]["author"]["id"]
 
454
  dic_papers_co_authors[author_name_norm]["Author's id(s)"] = coauthor_id[21:]
455
  else:
456
  dic_papers_co_authors[author_name_norm]["Author's id(s)"] = ""
457
+ dic_papers_co_authors[author_name_norm]["Number of occurence within the " + str(size) + " most related papers"] = 1
458
  dic_papers_co_authors[author_name_norm]["Number of related citations"] = dic_papers[paper]["cited_by_count"]
459
  else:
460
+ dic_papers_co_authors[author_name_norm]["Number of occurence within the " + str(size) + " most related papers"] += 1
461
  if author_name not in dic_papers_co_authors[author_name_norm]["Author's name(s)"]:
462
  dic_papers_co_authors[author_name_norm]["Author's name(s)"] += ", " + author_name
463
  if coauthor_id != None and coauthor_id[21:] not in dic_papers_co_authors[author_name_norm]["Author's id(s)"]:
 
505
 
506
 
507
 
508
+ dic_papers_co_authors = {k: v for k, v in sorted(dic_papers_co_authors.items(), key=lambda item: item[1]["Number of occurence within the " + str(size) + " most related papers"] , reverse = True)[:size]}
509
 
510
 
511
  dic_papers_map = {}