pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
407 stars 127 forks source link

Exception when handling `"author-list":null,` in AbstractRetrieval REF view #255

Closed lewisjiang closed 2 years ago

lewisjiang commented 2 years ago

pybliometrics version: 3.3.1.dev5

Code to reproduce the bug:

from pybliometrics.scopus import AbstractRetrieval
ab = AbstractRetrieval("10.1016/j.robot.2019.06.004", view='REF', id_type="doi", refresh=True)
print(ab.references)

Expected behavior: The reference entries returned by Scopus can have "author-list":null,, while the parsing logic https://github.com/pybliometrics-dev/pybliometrics/blob/008336d41068e3b2b112b87872b0271a55615f12/pybliometrics/scopus/abstract_retrieval.py#L522 does not consider this case before or in deduplicate().

Fix suggestion: Change https://github.com/pybliometrics-dev/pybliometrics/blob/008336d41068e3b2b112b87872b0271a55615f12/pybliometrics/scopus/utils/parse_content.py#L57 to

                 map(lambda x: [x], lst), [])
Michael-E-Rose commented 2 years ago

Unfortunately there are all kinds of rare irregularities in the Scopus API. It's good you keep bringing them up :)

BTW: You might also create a PR next time if you want!

lewisjiang commented 2 years ago

Sure, and thank you for maintaining this amazing tool for researchers!