Skip to content

Commit

Permalink
move index types to .compat
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Nov 29, 2022
1 parent 49a9015 commit b99d0d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions anndata/_core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import numpy as np
import pandas as pd
from scipy.sparse import spmatrix, issparse
from ..compat import DaskArray

Index1D = Union[slice, int, str, np.int64, np.ndarray]
Index = Union[Index1D, Tuple[Index1D, Index1D], spmatrix]
from ..compat import DaskArray, Index, Index1D


def _normalize_indices(
Expand Down
5 changes: 3 additions & 2 deletions anndata/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
from functools import reduce, singledispatch, wraps
from codecs import decode
from inspect import signature, Parameter
from typing import Any, Collection, Union, Mapping, MutableMapping, Optional
from typing import Any, Tuple, Union, Mapping, MutableMapping, Optional
from warnings import warn

import h5py
from scipy.sparse import spmatrix
import numpy as np
import pandas as pd

from .._core.index import Index1D
from ._overloaded_dict import _overloaded_uns, OverloadedDict


class Empty:
pass


Index1D = Union[slice, int, str, np.int64, np.ndarray]
Index = Union[Index1D, Tuple[Index1D, Index1D], spmatrix]
H5Group = Union[h5py.Group, h5py.File]
H5Array = h5py.Dataset

Expand Down

0 comments on commit b99d0d4

Please sign in to comment.