From 14b4c3dd68487b996539ad4377e9994efaa6e861 Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Fri, 8 Nov 2024 15:28:32 +0100 Subject: [PATCH] Add PYI lints (#1747) --- pyproject.toml | 1 + src/anndata/_core/anndata.py | 4 +--- src/anndata/_types.py | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 127ae3dc1..a3cb64cbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,6 +181,7 @@ select = [ "ICN", # Follow import conventions "PTH", # Pathlib instead of os.path "PT", # Pytest conventions + "PYI", # Typing ] ignore = [ # line too long -> we accept long comment lines; formatter gets rid of long code lines diff --git a/src/anndata/_core/anndata.py b/src/anndata/_core/anndata.py index 7ef9f8ac4..8a8eaf949 100644 --- a/src/anndata/_core/anndata.py +++ b/src/anndata/_core/anndata.py @@ -1169,9 +1169,7 @@ def _inplace_subset_obs(self, index: Index1D): self._init_as_actual(adata_subset) # TODO: Update, possibly remove - def __setitem__( - self, index: Index, val: int | float | np.ndarray | sparse.spmatrix - ): + def __setitem__(self, index: Index, val: float | np.ndarray | sparse.spmatrix): if self.is_view: raise ValueError("Object is view and cannot be accessed with `[]`.") obs, var = self._normalize_indices(index) diff --git a/src/anndata/_types.py b/src/anndata/_types.py index 66f8a9e29..2d9eb9980 100644 --- a/src/anndata/_types.py +++ b/src/anndata/_types.py @@ -25,6 +25,9 @@ "ArrayStorageType", "GroupStorageType", "StorageType", + "_ReadInternal", + "_ReadDaskInternal", + "_WriteInternal", ] ArrayStorageType: TypeAlias = ZarrArray | H5Array