Skip to content

Commit

Permalink
Fix C4 JR2 processing (csv contains only a single month) (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenek authored and Wooble committed Jul 8, 2020
1 parent 07d60f6 commit 7c24ab9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pycounter/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def _year_from_header(header, report):
elif report.report_type == "PR1" and report.report_version == 4:
first_date_col = 4
elif report.report_type == "JR2":
first_date_col = 11
first_date_col = 9
year = int(header[first_date_col].split("-")[1])
if year < 100:
year += 2000
Expand Down
1 change: 1 addition & 0 deletions pycounter/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def multiyear():
C4JR1mul.csv
C4JR1my.csv
C4JR2.csv
C4JR2_single_month.csv
PR1.tsv
simpleJR1.tsv
""".split()
Expand Down
11 changes: 11 additions & 0 deletions pycounter/test/data/C4JR2_single_month.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"Journal Report 2 (R4)","Access denied to Full-text Articles by Month, Journal and Category"
"University of Maximegalon"
""
"Period covered by Report:"
"2011-01-01 to 2011-12-31"
"Date run:"
2012-02-21
Journal,Publisher,Platform,"Journal DOI","Proprietary Identifier","Print ISSN","Online ISSN","Access Denied Category","Reporting Period Total",Jan-2011
"Total for all journals","Maximegalon University Press",MJO,,,,,3,3
"Abstracts of Working Papers in Economics","Maximegalon University Press",MJO,,,0951-0079,0951-0079,Access denied: concurrent/simultaneous user license limit exceeded,2,2
"Acta Numerica","Maximegalon University Press",MJO,,,0962-4929,1474-0508,Access denied: concurrent/simultaneous user license limit exceeded,1,1

0 comments on commit 7c24ab9

Please sign in to comment.