Skip to content

Commit

Permalink
TR_J1: correctly report line metrics as "Total_Item_Requests"
Browse files Browse the repository at this point in the history
(Formerly reported as "FT Article Requests" for compatibility with
Hermit ERM.)

Report metric for COUNTER 5 will be set to None, as COUNTER 5 reports
contain multiple metrics.
  • Loading branch information
Wooble committed Jun 12, 2019
1 parent eb72830 commit e27e593
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pycounter/sushi5.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def raw_to_full(raw_report):
report_type=header["Report_ID"],
customer=header.get("Institution_Name", ""),
institutional_identifier=header.get("Customer_ID", ""),
metric="FT Item Requests", # FIXME: this is for COUNTER4 compatibility
metric=None, # COUNTER 5 reports usually contain multiple metrics
date_run=pendulum.parse(date_run) if date_run else datetime.datetime.now(),
)

Expand Down Expand Up @@ -99,7 +99,7 @@ def raw_to_full(raw_report):
platform=platform,
publisher=publisher_name,
period=report.period,
metric=report.metric,
metric="Total_Item_Requests",
issn=identifiers["issn"],
eissn=identifiers["eissn"],
doi=identifiers["doi"],
Expand Down
2 changes: 1 addition & 1 deletion pycounter/test/counter5/test_sushi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_data(sushi5_report):
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
assert metrics[0] == u"Total_Item_Requests"


def test_doi(sushi5_report):
Expand Down

0 comments on commit e27e593

Please sign in to comment.