sosia-dev / sosia

Sosia: Automatic author matching in Scopus on-line
https://sosia.readthedocs.io/
MIT License
11 stars 3 forks source link

IndexError getting country #11

Closed Michael-E-Rose closed 5 years ago

Michael-E-Rose commented 5 years ago
>>> from sosia.classes import Scientist
>>> dietmar = Scientist(['6701809842'], 2000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/michaelerose/Documents/software/sosia/sosia/classes/scientist.py", line 167, in __init__
    self._country = find_country(identifier, self._publications, year)
  File "/home/michaelerose/Documents/software/sosia/sosia/utils.py", line 116, in find_country
    return Counter(countries).most_common(1)[0][0]
IndexError: list index out of range
Michael-E-Rose commented 5 years ago

The problem is again related to errors in the Scopus database. The corresponding article, 2-s2.0-0033416992, confuses all affiliations for all four authors and only assigns one ID to the last author.

Nevertheless we need to handle this, ideally by recursively calling the function for the previous year.