CUB-Libraries-CTA / counter-data-loader

Loads COUNTER database from JR1 report spreadsheets
1 stars 2 forks source link

Looking up publication ID where there is no platform defined raises an exception #1

Closed ghost closed 4 years ago

ghost commented 4 years ago

This error manifested itself when processing the 2017 Nature.com publications. The current processing algorithm assumes that the platform (column C in the spreadsheet) is the same for all listed publications. In the case of the 2017 Nature.com JR1 report, however, this is not the case.

Row 170 lists Palgrave Communications as the publication title, Palgrave Macmillan as the publisher, and palgrave-journals.com as the platform. It is the latter value that is causing the exception when doing a publication_id lookup (lines 170-181 in counterdb.py) as that platform does not exist in the platform table.

ghost commented 4 years ago

Added error checking to UsageStat class that handles situations where a platform specified in the current JR1 report has not yet been added to the database. In those situations, the platform and related publisher and publication are added to their respective tables before usage stats are added.