[MRG] Replaced coo_matrix with coo_array better compatability and added tes… by nathanneike · Pull Request #782 · PythonOT/POT

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves the codebase)

Motivation and context / Related issue

Modernizes the POT backend by migrating from the deprecated scipy.sparse.coo_matrix to the modern scipy.sparse.coo_array API. 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)

  • Updated NumPy backend coo_matrix() method to return coo_array instead of coo_matrix
  • Updated sparse_coo_data() to handle both coo_array and coo_matrix for backward compatibility
  • Added test case verifying coo_array element-wise multiplication functionality
  • All 2972 tests pass successfully

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.