Skip to content

Commit

Permalink
Implement AnyRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovarrone committed Jul 2, 2024
1 parent 44106ad commit 5eb35ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/cellcharter/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

from typing import Union

import numpy as np

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


def str2list(value: Union[str, list]) -> list:
"""Check whether value is a string. If so, converts into a list containing value."""
Expand Down
3 changes: 2 additions & 1 deletion src/cellcharter/tl/_gmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
from pycave.bayes.gmm.lightning_module import GaussianMixtureLightningModule
from pycave.bayes.gmm.model import GaussianMixtureModel
from pytorch_lightning import Trainer
from scanpy._utils import AnyRandom
from sklearn.cluster import KMeans, MiniBatchKMeans

from .._utils import AnyRandom

logger = logging.getLogger(__name__)


Expand Down

0 comments on commit 5eb35ea

Please sign in to comment.