pybliometrics-dev / pybliometrics

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

freetoread TypeError #236

Closed raffaem closed 2 years ago

raffaem commented 2 years ago
$ python3
Python 3.10.1 (main, Dec  9 2021, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybliometrics
>>> print(pybliometrics.__version__)
3.2.1.dev2
>>> from pybliometrics import AuthorRetrieval
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'AuthorRetrieval' from 'pybliometrics' (/run/media/raffaele/55ab61c4-83cf-4d9f-a5cd-7fcfdc14b4fb/data/progetti_miei/pybliometrics/pybliometrics/__init__.py)
>>> from pybliometrics.scopus import AuthorRetrieval
>>> a = AuthorRetrieval("36187933500")
>>> a = AuthorRetrieval("36187933500", refresh=True)
>>> p = a.get_documents(refresh=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/run/media/raffaele/55ab61c4-83cf-4d9f-a5cd-7fcfdc14b4fb/data/progetti_miei/pybliometrics/pybliometrics/scopus/author_retrieval.py", line 336, in get_documents
    return s.results
  File "/run/media/raffaele/55ab61c4-83cf-4d9f-a5cd-7fcfdc14b4fb/data/progetti_miei/pybliometrics/pybliometrics/scopus/scopus_search.py", line 99, in results
    freetoread=freetoread[-1]["$"],
TypeError: string indices must be integers
Michael-E-Rose commented 2 years ago

I don't know how you got at "3.2.1.dev2" because there's only been one commit since the last release, and this one commit solves the particular bug you found. That was yesterday in f7023805bce5be49f3a180a5fee6db39ef6123e5.

raffaem commented 2 years ago

I don't know how you got at "3.2.1.dev2"

I don't know either.

I cloned the repo and made my own changes, without changing the version number.

there's only been one commit since the last release, and this one commit solves the particular bug you found. That was yesterday in f702380.

Yeah it solves it.

Thank you for your work and for making pybliometrics public :)

Michael-E-Rose commented 2 years ago

When you tested this within your cloned repo, then the version number applies to your repo. Better be sure to test bugs in a neutral folder.