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

Fix sparse diag by upgrading SciPy and Numpy and dropping Python 3.9 #650

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

maximelucas
Copy link
Collaborator

@maximelucas maximelucas commented Jan 27, 2025

Fixes #649.

The problems seems to be due to a bug from SciPy that made setdiag() not set the whole diagonal to 0 in some cases for sparse arrays. It's been fixed by this PR since, and included in the 1.15 SciPy release.

I just upped our SciPy version in the requirements and added a test.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.45%. Comparing base (b86da86) to head (57a6a21).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #650   +/-   ##
=======================================
  Coverage   93.45%   93.45%           
=======================================
  Files          64       64           
  Lines        4993     4993           
=======================================
  Hits         4666     4666           
  Misses        327      327           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maximelucas
Copy link
Collaborator Author

maximelucas commented Jan 27, 2025

Tests for Python 3.9 fail because SciPy 1.15 requires Python 3.10-3.13 (and NumPy 1.23.5 or greater.)

Python 3.9's end of life is planned for Oct 2025.
Would dropping it already be a problem? @nwlandry

@nwlandry
Copy link
Collaborator

nwlandry commented Jan 27, 2025

Tests for Python 3.9 fail because SciPy 1.15 requires Python 3.10-3.13 (and NumPy 1.23.5 or greater.)

Python 3.9's end of life is planned for Oct 2025. Would dropping it already be a problem? @nwlandry

It doesn't make sense to defer this essential fix to align with Python's release schedule. I am good with you removing v3.9 (just make a note in the PR title as well maybe?)

@maximelucas maximelucas changed the title Fix sparse diag Fix sparse diag by upgrading SciPy and Numpy Jan 27, 2025
Copy link
Collaborator

@nwlandry nwlandry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, @maximelucas! Good to squash and merge!

@maximelucas
Copy link
Collaborator Author

maximelucas commented Jan 27, 2025

Agreed. I also upgraded NumPy as required by SciPy.

This was an important bug to fix, but for some reason I only ever noticed it in "email-enron", and even then, only the smaller eigenvalues were affected. So hopefully, the bug hasn't had too much of an impact.

@maximelucas maximelucas merged commit 29880f9 into main Jan 27, 2025
20 checks passed
@maximelucas maximelucas deleted the fix_sparse_diag branch January 27, 2025 16:17
@maximelucas maximelucas changed the title Fix sparse diag by upgrading SciPy and Numpy Fix sparse diag by upgrading SciPy and Numpy and dropping Python 3.9 Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sparse adjacency is wrong in "email-enron" dataset
2 participants