Skip to content

Commit

Permalink
Add PYI lints (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Nov 8, 2024
1 parent 6ae9de8 commit 14b4c3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/anndata/_core/anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/anndata/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"ArrayStorageType",
"GroupStorageType",
"StorageType",
"_ReadInternal",
"_ReadDaskInternal",
"_WriteInternal",
]

ArrayStorageType: TypeAlias = ZarrArray | H5Array
Expand Down

0 comments on commit 14b4c3d

Please sign in to comment.