pybliometrics-dev / pybliometrics

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

__str__ not always working #306

Closed Michael-E-Rose closed 6 months ago

Michael-E-Rose commented 8 months ago

The str dunder for each class prints out some basic information. However, depending on the view, not all information is present, resulting in an ugly Exception.

For example print(str(AbstractRetrieval("2-s2.0-85166620539", view="META"))) doesn't work.

Some tasks:

nils-herrmann commented 8 months ago

There are 4 class-view combinations that trow an error:

nr class view query error_description
1 AbstractRetrieval META scopus_object = AbstractRetrieval('S092427162100068X', view="META") '@id'
2 AbstractRetrieval REF scopus_object = AbstractRetrieval('S092427162100068X', view="REF") 'NoneType' object is not subscriptable
3 AuthorRetrieval LIGHT scopus_object = AuthorRetrieval('7004212771', view="LIGHT") 'NoneType' object is not subscriptable
4 AuthorRetrieval METRICS scopus_object = AuthorRetrieval('7004212771', view="METRICS") 'NoneType' object is not subscriptable