[MRG] Replaced coo_matrix with coo_array better compatability and added tes…#782
Merged
Merged
Conversation
…t to test coo_array functionnality
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #782 +/- ##
=======================================
Coverage 97.07% 97.07%
=======================================
Files 107 107
Lines 22138 22142 +4
=======================================
+ Hits 21490 21495 +5
+ Misses 648 647 -1 🚀 New features to boost your workflow:
|
rflamary
reviewed
Dec 2, 2025
rflamary
left a comment
Collaborator
There was a problem hiding this comment.
We should completely cleanup the backend from coo_mari and csc_matrix. See comments below.
| import scipy.linalg | ||
| import scipy.special as special | ||
| from scipy.sparse import coo_matrix, csr_matrix, issparse | ||
| from scipy.sparse import coo_array, coo_matrix, csr_matrix, issparse |
Collaborator
There was a problem hiding this comment.
Suggested change
| from scipy.sparse import coo_array, coo_matrix, csr_matrix, issparse | |
| from scipy.sparse import coo_array, csr_array, issparse |
Collaborator
There was a problem hiding this comment.
onl arrays should be used
| # Convert to COO format if needed | ||
| if not isinstance(a, coo_matrix): | ||
| a_coo = coo_matrix(a) | ||
| if not isinstance(a, (coo_array, coo_matrix)): |
Collaborator
There was a problem hiding this comment.
Suggested change
| if not isinstance(a, (coo_array, coo_matrix)): | |
| if not isinstance(a, coo_array): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Types of changes
Motivation and context / Related issue
Modernizes the POT backend by migrating from the deprecated
scipy.sparse.coo_matrixto the modernscipy.sparse.coo_arrayAPI. This ensures future compatibility as SciPy moves away from matrix-based sparse classes in favor of array-based ones.How has this been tested (if it applies)
coo_matrix()method to returncoo_arrayinstead ofcoo_matrixsparse_coo_data()to handle bothcoo_arrayandcoo_matrixfor backward compatibilitycoo_arrayelement-wise multiplication functionalityPR checklist