Skip to content

Comments

Squeeze out dimension added in modern anndata#179

Merged
casblaauw merged 1 commit intomainfrom
fix_normalization_weights_plot
Feb 3, 2026
Merged

Squeeze out dimension added in modern anndata#179
casblaauw merged 1 commit intomainfrom
fix_normalization_weights_plot

Conversation

@casblaauw
Copy link
Collaborator

Not sure when this changed, but it seems modern versions of anndata force obsm entries to be 2D. Our adata.obsm['weights'] was previously 1D ((n_obs,)), but now it's turned into a (n_obs, 1) matrix after adding it to the adata. crested.pl.bar.normalization_weights() depended on it being 1D, so squeezing it fixes the problem.

I checked and the actual X values don't seem to be affected (nor do the values of the normalization weights), it's really just the shape. I noticed this in the plotting tests I'm adding in #166, where it fails for all python versions. It doesn't fail in my existing local environment, but it does in a newly created one, so that's why I'm assuming it's to do with a new anndata version (since I also checked that the calculated matrix before putting it into the anndata is still 1D).

@casblaauw
Copy link
Collaborator Author

Readthedocs failing: see #166 comment, only warnings, should work for now. This bugfix is more important anyway.

@casblaauw casblaauw merged commit 2788064 into main Feb 3, 2026
10 of 11 checks passed
@casblaauw casblaauw deleted the fix_normalization_weights_plot branch February 3, 2026 23:57
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.

1 participant