File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 94
94
ZarrArray .__module__ = ZarrGroup .__module__ = "zarr"
95
95
96
96
97
- if TYPE_CHECKING or find_spec ( "anndata" ) :
97
+ if TYPE_CHECKING :
98
98
from anndata .abc import CSCDataset , CSRDataset # type: ignore[import-untyped]
99
99
else : # pragma: no cover
100
- CSRDataset = type ("CSRDataset" , (), {})
101
- CSCDataset = type ("CSCDataset" , (), {})
102
- CSRDataset .__module__ = CSCDataset .__module__ = "anndata.abc"
100
+ try : # only exists in anndata 0.11+
101
+ from anndata .abc import CSCDataset , CSRDataset # type: ignore[import-untyped]
102
+ except ImportError :
103
+ CSRDataset = type ("CSRDataset" , (), {})
104
+ CSCDataset = type ("CSCDataset" , (), {})
105
+ CSRDataset .__module__ = CSCDataset .__module__ = "anndata.abc"
103
106
CSDataset = CSRDataset | CSCDataset
104
107
"""Anndata sparse out-of-core matrices."""
You can’t perform that action at this time.
0 commit comments