Skip to content

docs: document the adata.uns['hvg'] output of pp.highly_variable_genes - #4344

Open
asharaali wants to merge 1 commit into
scverse:mainfrom
asharaali:docs/hvg-uns-output
Open

docs: document the adata.uns['hvg'] output of pp.highly_variable_genes#4344
asharaali wants to merge 1 commit into
scverse:mainfrom
asharaali:docs/hvg-uns-output

Conversation

@asharaali

@asharaali asharaali commented Sep 3, 2026

Copy link
Copy Markdown
  • Release notes not necessary because: documentation-only change to an existing docstring

pp.highly_variable_genes writes adata.uns['hvg'] = {'flavor': flavor} when inplace=True, but the Returns section documents only the adata.var columns. pl.highly_variable_genes reads that entry to pick which metrics to plot, so deleting it raises KeyError: 'hvg'.

Adds one entry to Returns. No behaviour change.

…enes`

`highly_variable_genes` writes `adata.uns['hvg'] = {'flavor': flavor}` when
`inplace=True`, on both the dispersion-based and the seurat_v3 paths, but the
`Returns` section lists only the `adata.var` columns.

The entry is part of the contract with downstream code rather than incidental
bookkeeping: `pl.highly_variable_genes` reads `adata.uns['hvg']['flavor']` to
choose whether to plot dispersions or variances, in both the legacy and the
holoviews backends, and raises `KeyError: 'hvg'` without it.

Closes scverse#4341

Signed-off-by: Ashar Ali <aaa467@njit.edu>
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.98%. Comparing base (ec37402) to head (4a66c9a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4344   +/-   ##
=======================================
  Coverage   81.98%   81.98%           
=======================================
  Files         134      134           
  Lines       13235    13235           
=======================================
  Hits        10851    10851           
  Misses       2384     2384           
Flag Coverage Δ
hatch-test.low-vers 79.07% <ø> (ø)
hatch-test.pre 81.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/preprocessing/_highly_variable_genes.py 94.63% <ø> (ø)

@Zethson

Zethson commented Sep 5, 2026

Copy link
Copy Markdown
Member

Please cut down the PR description with the AI slop

@asharaali

Copy link
Copy Markdown
Author

Trimmed.

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.

The .uns output for scanpy.pp.highly_variable_genes is not documented

2 participants