typing

The two submodules differ depending on their runtime properties:

fast_array_utils.types

Shared types that can be used e.g. in isinstance() checks.

fast_array_utils.types.CSBase = scipy.sparse.csc_matrix | scipy.sparse.csr_matrix | scipy.sparse.csc_array | scipy.sparse.csr_array

A sparse compressed matrix or array.

fast_array_utils.types.CSDataset = anndata.abc.CSRDataset | anndata.abc.CSCDataset

Anndata sparse out-of-core matrices.

fast_array_utils.typing

Type categories to be used in type annotations.

fast_array_utils.typing.CpuArray: TypeAlias = numpy.ndarray[tuple[int, ...], numpy.dtype[typing.Any]] | scipy.sparse.csc_matrix | scipy.sparse.csr_matrix | scipy.sparse.csc_array | scipy.sparse.csr_array

Arrays and matrices stored in CPU memory.

fast_array_utils.typing.DiskArray: TypeAlias = h5py.Dataset | zarr.Array

Arrays and matrices stored on disk.

fast_array_utils.typing.GpuArray: TypeAlias = cupy.ndarray | cupyx.scipy.sparse.csr_matrix | cupyx.scipy.sparse.csc_matrix

Arrays and matrices stored in GPU memory.