Skip to content

Commit

Permalink
Merge pull request #29 from ehenneken/ref_stats_bug
Browse files Browse the repository at this point in the history
fix for reporting bug
  • Loading branch information
ehenneken authored Oct 29, 2024
2 parents a66eebc + e718935 commit 1d2ac01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
# ============================= APPLICATION ==================================== #
#
# Collections we are reporting on
COLLECTIONS = ['AST', 'HP', 'PS', 'HP_AST', 'PS_AST', 'CORE', 'ES', 'OA']
COLLECTIONS = ['CORE_AST', 'AST', 'HP', 'PS', 'HP_AST', 'PS_AST', 'CORE', 'ES', 'OA']
# Report formats supported
FORMATS = ['NASA', 'CURATORS', 'MISSING']
# Report types supported
SUBJECTS = ['FULLTEXT', 'REFERENCES', 'SUMMARY', 'METADATA']
# Which journals are we reporting on per collection
JOURNALS = {
'CORE_AST':['A&A','A&ARv','A&AS','AJ','AN','APh','ApJ','ApJL','ApJS','ARA&A','NatAs','PASP'],
'AST': ['A&A','A&ARv','A&AS','AJ','AN','APh','ApJ','ApJL','ApJS','ARA&A','ARep','AsBio','AstL','CeMDA','FrASS','Galax','GeCoA','IAUS','IJAsB','JCAP','MNRAS','NatAs','PASA','PASJ','PASP','RAA','RNAAS','SCPMA','Univ','ASPC'],
'PS': ["AREPS","ASTRA","AdSpR","AnGeo","Ap&SS","AsBio","CeMDA","E&PSL","EM&P","GeCoA","IJAsB","Icar","JAtS",
"JGRA","JGRD","JGRE","M&PS","M&PSA","Metic","NatGe","P&SS","PEPI","RvGeo","SSRv","SoSyR","SoPh",
Expand Down
5 changes: 1 addition & 4 deletions xreport/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,14 @@ def _get_reference_data(self, rtype):
"""
for journal in self.journals:
cov_dict = {}
matched = unmatched = 0
# For each volume of the journals in the collection we retrieve that reference matching level
for volume in sorted(self.statsdata[journal]['pubdata'].keys()):
try:
ok, fail = self._process_one_volume(journal, volume, rtype)
except:
ok = fail = 0
matched += ok
unmatched += fail
try:
frac = 100*float(matched)/float(unmatched+matched)
frac = 100*float(ok)/float(ok+fail)
except:
frac = 0.0
if journal in self.config.get("YEAR_IS_VOL"):
Expand Down

0 comments on commit 1d2ac01

Please sign in to comment.