forked from scverse/scanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sparse_mean_variance_axis
now uses all cores (scverse#3015)
Co-authored-by: Philipp A <[email protected]>
- Loading branch information
1 parent
ee8505b
commit a70582e
Showing
6 changed files
with
116 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
from __future__ import annotations | ||
|
||
from functools import cache | ||
from typing import TYPE_CHECKING | ||
|
||
import pooch | ||
|
||
import scanpy as sc | ||
|
||
if TYPE_CHECKING: | ||
from anndata import AnnData | ||
|
||
_pbmc68k_reduced: AnnData | None = None | ||
|
||
@cache | ||
def _pbmc68k_reduced() -> AnnData: | ||
return sc.datasets.pbmc68k_reduced() | ||
|
||
|
||
def pbmc68k_reduced() -> AnnData: | ||
return _pbmc68k_reduced().copy() | ||
|
||
|
||
@cache | ||
def _pbmc3k() -> AnnData: | ||
return sc.datasets.pbmc3k() | ||
|
||
|
||
def pbmc3k() -> AnnData: | ||
return _pbmc3k().copy() | ||
|
||
|
||
@cache | ||
def _lung93k() -> AnnData: | ||
path = pooch.retrieve( | ||
url="https://figshare.com/ndownloader/files/45788454", | ||
known_hash="md5:4f28af5ff226052443e7e0b39f3f9212", | ||
) | ||
return sc.read_h5ad(path) | ||
|
||
|
||
def pbmc68k_reduced(): | ||
global _pbmc68k_reduced | ||
if _pbmc68k_reduced is None: | ||
_pbmc68k_reduced = sc.datasets.pbmc68k_reduced() | ||
return _pbmc68k_reduced.copy() | ||
def lung93k() -> AnnData: | ||
return _lung93k().copy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters