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

Deprecate .A attributes of sparse matrix in Sijie july24 fix #691

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

Sichao25
Copy link
Collaborator

@Sichao25 Sichao25 commented Jul 9, 2024

Replace .A with toarray() since SciPy 1.14.0 removed .A attributes for sparse matrix objects.

@Sichao25 Sichao25 marked this pull request as ready for review July 9, 2024 16:25
@Sichao25 Sichao25 requested a review from chansigit July 9, 2024 16:25
@@ -443,5 +443,5 @@ def sctransform(
X_squared = adata.X.copy()
X_squared.data **= 2
variance = X_squared.mean(0) - np.square(adata.X.mean(0))
adata.var["sct_score"] = variance.toarray().ravel() if sp.issparse(variance) else variance.ravel()
adata.var["sct_score"] = variance.A1
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please double check if this line would work properly if variance is a sparse matrix

Copy link
Contributor

Choose a reason for hiding this comment

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

since you've validated variance is not sparse, i've no additional comments

@chansigit chansigit merged commit c9fa676 into aristoteleo:sijie-july24-fix Jul 10, 2024
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