diff --git a/query.py b/query.py index 84ee02f1228687939521d866fc29317e03f67c92..34ea892c34a8f8ac0a283871c8e72a1ee45ce3c3 100644 --- a/query.py +++ b/query.py @@ -1,23 +1,24 @@ from myads.query import ADSQueryWrapper +from operator import itemgetter, attrgetter import yaml import sys import math # Query papers citing the two SWIFT ADS entries query = ADSQueryWrapper(sys.argv[1]) -query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S) or citations(2023arXiv230513380S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract,volume,issue,page,citation_count", rows=1000) +query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S) or citations(2024MNRAS.530.2378S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract,volume,issue,page,citation_count", rows=1000) paper_list = list(query_data.papers) total_citations = 0 -query_data = query.get("citations(2016pasc.conf....2S)", fl="bibcode", rows=1000) -citations_pasc = len(list(query_data.papers)) +query_data_pasc = query.get("citations(2016pasc.conf....2S)", fl="bibcode", rows=1000) +citations_pasc = len(list(query_data_pasc.papers)) -query_data = query.get("citations(2018ascl.soft05020S)", fl="bibcode", rows=1000) -citations_ascl = len(list(query_data.papers)) +query_data_ascl = query.get("citations(2018ascl.soft05020S)", fl="bibcode", rows=1000) +citations_ascl = len(list(query_data_ascl.papers)) # Process the data to make the title a string and not an array of strings for paper in paper_list: - if paper.bibcode == "2023arXiv230513380S": + if paper.bibcode == "2024MNRAS.530.2378S": to_remove = paper citations_release = paper.citation_count @@ -36,14 +37,25 @@ for paper in paper_list: paper.abstract = paper.abstract.replace("<P />", "") total_citations += paper.citation_count +# Remove self-contribution paper_list.remove(to_remove) +# Compute h-index of citing papers +paper_list_copy = paper_list.copy() +paper_list_copy.sort(key=attrgetter('citation_count'),reverse=True) +h_index = 1 +for paper in paper_list_copy: + if paper.citation_count >= h_index: + h_index += 1 +h_index -= 1 + # Create a dictionary of cards my_list = dict({"num_papers": query_data.num_found - 1, "total_citations": total_citations, "citations_release": citations_release, "citations_pasc": citations_pasc, "citations_ascl": citations_ascl, + "h_index": h_index, "cards": paper_list}) # Silence the yaml object naming diff --git a/templates/pubs.html b/templates/pubs.html index 0acf7d71aa7106bdeb3505249a7b402b2df4258d..03deacdfe50723797413bf45c2784370269f887d 100644 --- a/templates/pubs.html +++ b/templates/pubs.html @@ -14,16 +14,16 @@ </div> <div class="card-text"> - <h4><a href="https://ui.adsabs.harvard.edu/abs/2023arXiv230513380S/abstract">SWIFT: A modern highly-parallel gravity and smoothed particle hydrodynamics + <h4><a href="https://ui.adsabs.harvard.edu/abs/2024MNRAS.530.2378S/abstract">SWIFT: A modern highly-parallel gravity and smoothed particle hydrodynamics solver for astrophysical and cosmological applications</a> </h4> - <p>  Schaller M. et al., <i>MNRAS</i>, 2024   (citations: {{ citations_release }}) + <p>  Schaller M. et al., <i>MNRAS</i>, May 2024, Vol. 530, Issue 2, pp. 2378-2419   (citations: {{ citations_release }}) <h4><a href="https://ui.adsabs.harvard.edu/abs/2016pasc.conf....2S/abstract">SWIFT: SPH With Inter-dependent Fine-grained Tasking </a> </h4> - <p>  Schaller M. et al., <i>Astrophysics Source Code Library</i>, 2018, <a href="https://ascl.net/1805.020">record ascl:1805.020</a>   (citations: {{ citations_ascl }}) + <p>  Schaller M. et al., <i>Astrophysics Source Code Library</i>, 2018, ascl:<a href="https://ascl.net/1805.020">1805.020</a>   (citations: {{ citations_ascl }}) <h4><a href="https://ui.adsabs.harvard.edu/abs/2016pasc.conf....2S/abstract">SWIFT: Using Task-Based Parallelism, Fully Asynchronous Communication, and Graph Partition-Based Domain Decomposition for Strong Scaling on more than 100,000 Cores </a> </h4> - <p>  Schaller M. et al., <i>PASC</i>, 2016, vol. 1   (citations: {{ citations_pasc }}) + <p>  Schaller M. et al., <i>PASC</i>, 2016, Vol. 1, Article Id. 2   (citations: {{ citations_pasc }}) </div> @@ -33,8 +33,10 @@ </div> <div> The following {{ num_papers }} publications have used - SWIFT (directly or indirectly) to obtain their results. They - have jointly gathered {{ total_citations }} citations.</div> + SWIFT (directly or indirectly) to obtain their results. + <p>They have jointly gathered {{ total_citations }} citations and have + an h-index of {{ h_index }}. + </div> {% set count = num_papers %}