diff --git a/query.py b/query.py index 3b54b983cc72921b8dcc0f1a728836a47765ac29..e00b7429cac4438c2578abfe9fc0d0b75464746a 100644 --- a/query.py +++ b/query.py @@ -1,11 +1,12 @@ from myads.query import ADSQueryWrapper 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) -paper_list = query_data.papers +paper_list = list(query_data.papers) total_citations = 0 # Process the data to make the title a string and not an array of strings @@ -17,10 +18,11 @@ for paper in paper_list: if len(paper.title) == 1: paper.title = paper.title[0] paper.bibstem = paper.bibstem[0] - if hasattr(paper, "page"): + if hasattr(paper, "page") and "PhDT" not in paper.bibcode: paper.page = paper.page[0] if hasattr(paper, "abstract"): - paper.abstract = paper.abstract.replace("<P />", "") + if not isinstance(paper.abstract, float): + paper.abstract = paper.abstract.replace("<P />", "") total_citations += paper.citation_count paper_list.remove(to_remove)