Skip to content

Enforce crs_matrix type when using tocsr()#1261

Open
spjuhel wants to merge 6 commits intodevelopfrom
1260-fix-csr_matrix-type-check
Open

Enforce crs_matrix type when using tocsr()#1261
spjuhel wants to merge 6 commits intodevelopfrom
1260-fix-csr_matrix-type-check

Conversation

@spjuhel
Copy link
Copy Markdown
Collaborator

@spjuhel spjuhel commented Mar 9, 2026

Changes proposed in this PR:

  • Wraps all calls of tocsr() in csr_matrix() to enforce the type.

This PR fixes #1260
See also #1255 and 5a6d536#diff-3175d04f0013b63b2662d6ced577cceeb7d458cc2a41d4711bbfff7f8577f0cbR61

PR Author Checklist

PR Reviewer Checklist

return sparse_coo.tocsr() # Convert sparse.COO to scipy.sparse.csr_array
return sparse.csr_matrix(
sparse_coo.tocsr()
) # Convert sparse.COO to scipy.sparse.csr_array
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
) # Convert sparse.COO to scipy.sparse.csr_array
) # Convert sparse.COO to scipy.sparse.csr_matrix

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.

2 participants