Skip to content

Commit

Permalink
Backport PR #2757: pp.highly_variable_genes handles subset and inplac…
Browse files Browse the repository at this point in the history
…e consistently (#2774)

Co-authored-by: Eljas Roellin <[email protected]>
  • Loading branch information
flying-sheep and eroell committed Dec 4, 2023
1 parent 70d55d5 commit 4058e36
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 103 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/1.9.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- Fix handling of numpy array palettes (e.g. after write-read cycle) {pr}`2734` {smaller}`P Angerer`
- Specify correct version of `matplotlib` dependency {pr}`2733` {smaller}`P Fisher`
- Fix {func}`scanpy.pl.violin` usage of `seaborn.catplot` {pr}`2739` {smaller}`E Roellin`
- Fix {func}`scanpy.pp.highly_variable_genes` to handle the combinations of `inplace` and `subset` consistently {pr}`2757` {smaller}`E Roellin`
6 changes: 5 additions & 1 deletion scanpy/datasets/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .._settings import settings
from ..readwrite import read, read_visium
from ._utils import check_datasetdir_exists, filter_oldformatwarning
from .._utils import AnyRandom

HERE = Path(__file__).parent

Expand All @@ -19,6 +20,7 @@ def blobs(
n_centers: int = 5,
cluster_std: float = 1.0,
n_observations: int = 640,
random_state: AnyRandom = 0,
) -> ad.AnnData:
"""\
Gaussian Blobs.
Expand All @@ -34,6 +36,8 @@ def blobs(
n_observations
Number of observations. By default, this is the same observation number
as in :func:`scanpy.datasets.krumsiek11`.
random_state
Determines random number generation for dataset creation.
Returns
-------
Expand All @@ -47,7 +51,7 @@ def blobs(
n_features=n_variables,
centers=n_centers,
cluster_std=cluster_std,
random_state=0,
random_state=random_state,
)
return ad.AnnData(X, obs=dict(blobs=y.astype(str)))

Expand Down
Loading

0 comments on commit 4058e36

Please sign in to comment.