sosia-dev / sosia

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

AttributeError in .find_matches() #10

Closed Michael-E-Rose closed 5 years ago

Michael-E-Rose commented 5 years ago
import sosia
fabian = sosia.Original(57131011400, 2017)
fabian.define_search_sources().define_search_group()
m = fabian.find_matches()
---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

<ipython-input-3-741144165f0e> in <module>()
----> 1 m = fabian.find_matches()

c:\users\rosm\appdata\local\programs\python\python36\lib\site-packages\sosia\sosia.py in find_matches(self, stacked, verbose, refresh, **kwds)
    455                 # Filter
    456                 min_year = int(min([p.coverDate[:4] for p in res]))
--> 457                 authors = set([a for p in res for a in p.authid.split(';')])
    458                 n_coauth = len(authors) - 1  # Subtract 1 for focal author
    459                 if ((len(res) not in _npapers) or (min_year not in _years) or

c:\users\rosm\appdata\local\programs\python\python36\lib\site-packages\sosia\sosia.py in <listcomp>(.0)
    455                 # Filter
    456                 min_year = int(min([p.coverDate[:4] for p in res]))
--> 457                 authors = set([a for p in res for a in p.authid.split(';')])
    458                 n_coauth = len(authors) - 1  # Subtract 1 for focal author
    459                 if ((len(res) not in _npapers) or (min_year not in _years) or

AttributeError: 'NoneType' object has no attribute 'split'

I think this is related to a buggy database entry for an article. Otherwose p.authid wouldn't be None.

Michael-E-Rose commented 5 years ago

This wasn't a bug. It was a broken cached file.