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
BUG: sparse matrix creation in 1.13 with indices not summing entries any more #20670
Comments
For the first part of the reproducer, on latest (np.int32(1), np.int32(0)) 1.0
(np.int32(1), np.int32(0)) 1.0
(np.int32(0), np.int32(1)) 1.0
|
This does indeed need a fix. It's a bug introduced in #19962 while trying to avoid multiple conversions between formats. And, yes -- the fix should get additional backport for 1.13.1 Thank you @m-reuter for reporting it! Thank you @tylerjereddy for the backports! |
Describe your issue.
The behaviour of sparse matrix (CSC, CSR) creation has changed in 1.13 breaking our code. Multiple data entries with the same indices are not summed up any longer but produce duplicate entries. I did not find this in the release notes. Maybe it is wanted this way, but the documentation explicitly states that conversion from COO to CSC sums up duplicate entries, so why drop this feature during creation?
Reproducing Code Example
Error message
No error message, just different sparse matrices at creation. I believe this is a bug, as the conversion, e.g. from COO format actually sums the entries as described here: https://docs.scipy.org/doc/scipy/reference/sparse.html#example-2 which is important for FEM matrices or adjacency matrices of a mesh.
SciPy/NumPy/Python version and system information
The text was updated successfully, but these errors were encountered: