Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Powers committed Apr 23, 2024
1 parent ebb46b1 commit 9114d43
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions chameleon/research_impacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,21 @@ def similarity_score(str1, str2):
states.add(uni["state"])
epscor_states = set(s for s in states if s in EPSCOR_STATES)


edu_states = set()
for uni in UNI_STATE_LIST:
if uni["name"] in edu_insts:
edu_states.add(uni["state"])
edu_epscor_states = set(s for s in edu_states if s in EPSCOR_STATES)


return {
"total": len(insts),
"msi_total": len(msi_found),
"states": len(states),
"epscor_states": len(epscor_states),

"edu_total": len(edu_insts),
"edu_msi_total": len(edu_msi_found),
"edu_states": len(edu_states),
"edu_epscor_states": len(edu_epscor_states),

}


Expand Down Expand Up @@ -219,10 +215,12 @@ def get_context():
tag=computing_education_tag,
).distinct()
active_education_projects_per_academic_year.append(
(f"Fall {year} - Spring {year+1}", ay_education_projects_with_active_allocations.count())
(
f"Fall {year} - Spring {year+1}",
ay_education_projects_with_active_allocations.count(),
)
)


publications_per_year = publication_information(start_year, end_year)

edu_users = get_education_users()
Expand All @@ -246,6 +244,7 @@ def get_context():
"edu_users": len(edu_users),
}


def get_education_users():
computing_education_tag = Tag.objects.get(name="Computing Education")
edu_users = set()
Expand Down Expand Up @@ -288,18 +287,13 @@ def publication_information(start_year, end_year):
def citation_report():
publications = []
for p in Publication.objects.all():
publications.append((
p,
max(s.citation_count for s in p.sources.all())
))
total = sum(
p[1] for p in publications
)
publications.append((p, max(s.citation_count for s in p.sources.all())))
total = sum(p[1] for p in publications)
gt100_unsorted = [
(f"{p[0].project} - {p[0].title}", p[1]) for p in publications if p[1] >= 100
]
gt100 = sorted(gt100_unsorted, key=lambda tup: tup[1], reverse=True)
return {
"total": total,
"gt100": gt100,
}
}

0 comments on commit 9114d43

Please sign in to comment.