Skip to content

Commit

Permalink
Backport PR #1747 on branch 0.11.x (Add PYI lints) (#1748)
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp A <flying-sheep@web.de>
  • Loading branch information
meeseeksmachine and flying-sheep authored Nov 8, 2024
1 parent 6ae9de8 commit 3aed0b6
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 3aed0b6

Please sign in to comment.