Skip to content

Commit

Permalink
chore(misc): print deprecation warning on import
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 committed Mar 11, 2024
1 parent 8668c20 commit ea0f379
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
8 changes: 7 additions & 1 deletion tests/test_velovi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import pytest
import scvelo as scv
from scvi.data import synthetic_iid

from velovi import VELOVI

def test_import():
with pytest.warns(UserWarning):
pass


def test_preprocess_data():
Expand All @@ -16,6 +20,8 @@ def test_preprocess_data():


def test_velovi():
from velovi import VELOVI

n_latent = 5
adata = synthetic_iid()
adata.layers["spliced"] = adata.X.copy()
Expand Down
21 changes: 16 additions & 5 deletions velovi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
"""velovi."""

import logging
import warnings

from rich.console import Console
from rich.logging import RichHandler
# warning has to be at the top level to print on import
warnings.warn(
"The velovi package is no longer being actively developed or maintained as of v0.4.0. Please "
"use the implementation in the scvi-tools package instead. For more information, see "
"https://github.com/scverse/scvi-tools/issues/2610.",
UserWarning,
stacklevel=1,
)

from ._constants import REGISTRY_KEYS
from ._model import VELOVI, VELOVAE
from ._utils import get_permutation_scores, preprocess_data
from rich.console import Console # noqa
from rich.logging import RichHandler # noqa

from ._constants import REGISTRY_KEYS # noqa
from ._model import VELOVI, VELOVAE # noqa
from ._utils import get_permutation_scores, preprocess_data # noqa

# https://github.com/python-poetry/poetry/pull/2366#issuecomment-652418094
# https://github.com/python-poetry/poetry/issues/144#issuecomment-623927302
Expand Down Expand Up @@ -35,6 +45,7 @@
# this prevents double outputs
logger.propagate = False


__all__ = [
"VELOVI",
"VELOVAE",
Expand Down

0 comments on commit ea0f379

Please sign in to comment.