Skip to content

Commit

Permalink
Fix scanpy anyrandom (#777)
Browse files Browse the repository at this point in the history
* Fix scanpy anyrandom

Signed-off-by: zethson <[email protected]>

* Restrict numpy

Signed-off-by: zethson <[email protected]>

* Restrict numpy

Signed-off-by: zethson <[email protected]>

---------

Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson authored Jul 17, 2024
1 parent 2ac2a54 commit f71f08e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ehrapy/preprocessing/_scanpy_pp_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import numpy as np
import scanpy as sc
from anndata import AnnData
from scanpy._utils import AnyRandom
from scipy.sparse import spmatrix

AnyRandom = Union[int, np.random.RandomState, None]


def pca(
data: Union[AnnData, np.ndarray, spmatrix],
Expand Down
3 changes: 2 additions & 1 deletion ehrapy/tools/_scanpy_tl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import scanpy as sc
from anndata import AnnData
from leidenalg.VertexPartition import MutableVertexPartition
from scanpy._utils import AnyRandom
from scipy.sparse import spmatrix

from ehrapy.tools import _method_options

AnyRandom = Union[int, np.random.RandomState, None]


def tsne(
adata: AnnData,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dependencies = [
"fknni",
"python-dateutil",
"filelock",
"numpy<2.0.0" # for compatiblity with lifelines
]

[project.optional-dependencies]
Expand Down

0 comments on commit f71f08e

Please sign in to comment.