/
__init__.py
77 lines (66 loc) · 1.74 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""Annotated multivariate observation data."""
try: # See https://github.com/maresb/hatch-vcs-footgun-example
from setuptools_scm import get_version
__version__ = get_version(root="..", relative_to=__file__)
except (ImportError, LookupError):
try:
from ._version import __version__
except ModuleNotFoundError:
raise RuntimeError(
"anndata is not correctly installed. Please install it, e.g. with pip."
) from None
# Allowing notes to be added to exceptions. See: https://github.com/scverse/anndata/issues/868
import sys
if sys.version_info < (3, 11):
# Backport package for exception groups
import exceptiongroup # noqa: F401
from ._core.anndata import AnnData
from ._core.merge import concat
from ._core.raw import Raw
from ._io import (
read_csv,
read_excel,
read_h5ad,
read_hdf,
read_loom,
read_mtx,
read_text,
read_umi_tools,
read_zarr,
)
from ._warnings import (
OldFormatWarning,
WriteWarning,
ImplicitModificationWarning,
ExperimentalFeatureWarning,
)
if True: # Bypass isort, this needs to come last
from . import experimental
def read(*args, **kwargs):
import warnings
warnings.warn(
"`anndata.read` is deprecated, use `anndata.read_h5ad` instead. "
"`ad.read` will be removed in mid 2024.",
FutureWarning,
)
return read_h5ad(*args, **kwargs)
__all__ = [
"__version__",
"AnnData",
"concat",
"Raw",
"read_h5ad",
"read_loom",
"read_hdf",
"read_excel",
"read_umi_tools",
"read_csv",
"read_text",
"read_mtx",
"read_zarr",
"OldFormatWarning",
"WriteWarning",
"ImplicitModificationWarning",
"ExperimentalFeatureWarning",
"experimental",
]