From 2f341dd5267797982f2134fab1ba954636a0a809 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Wed, 3 Apr 2024 12:12:28 +0200
Subject: [PATCH] Add the ASCL entry to the publications page

---
 query.py            | 12 ++++++++++++
 templates/pubs.html | 11 +++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/query.py b/query.py
index 92a2f90..84ee02f 100644
--- a/query.py
+++ b/query.py
@@ -9,6 +9,12 @@ query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.sof
 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 = query.get("citations(2018ascl.soft05020S)", fl="bibcode", rows=1000)
+citations_ascl = len(list(query_data.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":
@@ -18,6 +24,10 @@ for paper in paper_list:
     if len(paper.title) == 1:
         paper.title = paper.title[0]
     paper.bibstem = paper.bibstem[0]
+    if str(paper.issue) == 'nan':
+        delattr(paper, "issue")
+    if str(paper.volume) == 'nan':
+        delattr(paper, "volume")
     if hasattr(paper, "page") and "PhDT" not in paper.bibcode:
         if not isinstance(paper.page, float):
             paper.page = paper.page[0]
@@ -32,6 +42,8 @@ paper_list.remove(to_remove)
 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,
                 "cards": paper_list})
 
 # Silence the yaml object naming
diff --git a/templates/pubs.html b/templates/pubs.html
index 79002ee..0acf7d7 100644
--- a/templates/pubs.html
+++ b/templates/pubs.html
@@ -16,12 +16,15 @@
 
 	<h4><a href="https://ui.adsabs.harvard.edu/abs/2023arXiv230513380S/abstract">SWIFT: A modern highly-parallel gravity and smoothed particle hydrodynamics
 	    solver for astrophysical and cosmological applications</a> </h4>
-	<p>&emsp;  Schaller M. et al., <i>arXiv</i>, 2023, 2305.13380 &emsp;&emsp;(citations: {{ citations_release }})
+	<p>&emsp;  Schaller M. et al., <i>MNRAS</i>, 2024 &emsp;&emsp;(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>&emsp;  Schaller M. et al., <i>Astrophysics Source Code Library</i>, 2018, <a href="https://ascl.net/1805.020">record ascl:1805.020</a>  &emsp;&emsp;(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>&emsp;  Schaller M. et al., <i>PASC</i>, 2016, vol. 1 
-
+	<p>&emsp;  Schaller M. et al., <i>PASC</i>, 2016, vol. 1  &emsp;&emsp;(citations: {{ citations_pasc }})  
+	  
       </div>
 
       <br/>
@@ -50,7 +53,7 @@
 	{% if card.bibstem != "arXiv"  %}
 	  {% if card.volume %}
 	    , vol. {{ card.volume }}
-	    {% if card.issue %}
+	    {% if card.issue and card.issue != nan %}
 	       , issue {{ card.issue }}
 	    {% endif %}
 	  {% endif %}
-- 
GitLab