Skip to content

Commit

Permalink
include a kludgy metric on COUNTER 5 SUSHI reports for compatibility
Browse files Browse the repository at this point in the history
(This resolves a Pitt HSLS-specific blocker on bringing data from
COUNTER 5 SUSHI requests into our ERM in a compatible way, but
is far from ideal in a pure COUNTER 5 report. I suspect all
of the classes in the pycounter.report module will need to be
completely redesigned with a separate compatibility layer,
possibly outside of pycounter itself.)
  • Loading branch information
Wooble committed Apr 30, 2019
1 parent cce987f commit 15b3019
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions pycounter/sushi5.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _raw_to_full(raw_report):
"report_type": header["Report_ID"],
"customer": header.get("Institution_Name", u""),
"institutional_identifier": header.get("Customer_ID", u""),
"metric": "FT Item Requests", # FIXME: this is for COUNTER4 compatibility
"date_run": pendulum.parse(date_run) if date_run else datetime.datetime.now(),
}

Expand Down
6 changes: 6 additions & 0 deletions pycounter/test/counter5/test_sushi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ def test_data(sushi5_report):
publication = next(iter(sushi5_report))
data = [month[2] for month in publication]
assert 14 == data[0]


def test_metric(sushi5_report):
publication = next(iter(sushi5_report))
metrics = [month[1] for month in publication]
assert metrics[0] == u"FT Item Requests" # FIXME: COUNTER4 compat kludge
2 changes: 1 addition & 1 deletion pycounter/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""version information."""
__version__ = "2.0.0a1"
__version__ = "2.0.0a2"

0 comments on commit 15b3019

Please sign in to comment.