gensim
gensim copied to clipboard
Deprecation Warning for sparsetools namespace
I'm receiving a deprecation warning when using gensim within pytest. It's related to this issue https://github.com/RaRe-Technologies/gensim/issues/3014, but now with hopefully a much simpler solution.
DeprecationWarning: Please use `csc_matvecs` from the `scipy.sparse` namespace, the `scipy.sparse.sparsetools` namespace is deprecated.
Referencing here: https://github.com/RaRe-Technologies/gensim/blob/develop/gensim/models/lsimodel.py#LL69C1-L69C37
The latest deprecation warning now says to just change the import location, so should be very easy to resolve by changing:
from scipy.sparse import sparsetools
to
from scipy.sparse import csc_matvecs
Then updating references to csc_matvecs
Great! Can you test this out please & open a PR? Thanks.
Just tested but sadly the csc_matvecs functions only exists in sparsetools - the deprecation message was autogenerated and incorrect. However, the message can be removed by importing from _sparsetools instead of sparsetools