Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import deprecated scipy.linalg.triu from numpy.triu instead #3524

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

Luffy610
Copy link
Contributor

@Luffy610 Luffy610 commented Apr 3, 2024

The scipy package latest released has removed the triu function due to its support already provided in numpy package

Diff from the scipy library :
scipy/scipy@5721702#diff-6482beada610f60c724811cf77561f2bde8fd44ed2349939e505d28746a6d078

Removing the triu import from scipy library and getting it instead from numpy

Fixes #3525.

@piskvorky piskvorky added this to the Next release milestone Apr 3, 2024
@piskvorky piskvorky added the dependencies Pull requests that update a dependency file label Apr 3, 2024
@piskvorky piskvorky requested a review from mpenkov April 3, 2024 07:55
gensim/matutils.py Outdated Show resolved Hide resolved
@Luffy610
Copy link
Contributor Author

Luffy610 commented Apr 3, 2024

Done updated the PR

@piskvorky piskvorky changed the title Removing Import of depecrated triu function from scipy package Import deprecated scipy.lingalg.triu from numpy.triu insrtea Apr 3, 2024
@piskvorky piskvorky changed the title Import deprecated scipy.lingalg.triu from numpy.triu insrtea Import deprecated scipy.lingalg.triu from numpy.triu instead Apr 3, 2024
@piskvorky piskvorky changed the title Import deprecated scipy.lingalg.triu from numpy.triu instead Import deprecated scipy.linalg.triu from numpy.triu instead Apr 3, 2024
@piskvorky
Copy link
Owner

@mpenkov this fix seems important. Another maintenance release of Gensim may be timely anyway – drop unsupported Python versions, add new Python versions, etc.

WDYT? How about a release session, one of these days?

@mpenkov
Copy link
Collaborator

mpenkov commented Apr 5, 2024

Sure, we need to work out what's going on with the Windows builds, first. That's been on my todo list for a while.

@mpenkov mpenkov merged commit ad68ee3 into piskvorky:develop Apr 5, 2024
15 of 16 checks passed
@piskvorky piskvorky mentioned this pull request Apr 5, 2024
@unlimitedsola
Copy link

The failing Windows builds seem to be caused by pypa/cibuildwheel#1740.
Looks like #3523 solves the issue as all workflows are finished successfully.

@mpenkov
Copy link
Collaborator

mpenkov commented Apr 6, 2024

Thank you for pointing that out @unlimitedsola

ghpzin added a commit to ghpzin/nixpkgs that referenced this pull request May 2, 2024
python3Packages.scipy update to 1.13.0 removed triu.
Patch from upstream commit replaces it with numpy.triu
if import from scipy.linalg.triu fails.

piskvorky/gensim#3524
scipy/scipy#19674
aecio added a commit to VIDA-NYU/bdi-kit that referenced this pull request May 23, 2024
Pinning scipy to version lower than 1.13 to avoid the following error:
ImportError: cannot import name 'triu' from 'scipy.linalg'
(/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/scipy/linalg/__init__.py)

This version restriction can be removed when packages that depend on
triu are fixed. See e.g.:
- piskvorky/gensim#3524
- scipy/scipy#20402
aecio added a commit to VIDA-NYU/bdi-kit that referenced this pull request May 23, 2024
Pinning scipy to version lower than 1.13 to avoid the following error:
ImportError: cannot import name 'triu' from 'scipy.linalg'
(/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/scipy/linalg/__init__.py)

This version restriction can be removed when packages that depend on
triu are fixed. See e.g.:
- piskvorky/gensim#3524
- scipy/scipy#20402
@philicious
Copy link

I'd like to express interest in a new release with this fix :)

aecio added a commit to VIDA-NYU/bdi-kit that referenced this pull request Jul 26, 2024
Pinning scipy to version lower than 1.13 to avoid the following error:
ImportError: cannot import name 'triu' from 'scipy.linalg'
(/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/scipy/linalg/__init__.py)

This version restriction can be removed when packages that depend on
triu are fixed. See e.g.:
- piskvorky/gensim#3524
- scipy/scipy#20402
@Draic
Copy link

Draic commented Jul 30, 2024

why is the 4.3.3 release missing from the github release page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gensim broken with SciPy 1.13.0
7 participants