Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
id: changes
with:
filters: | # this is intentionally a string
relnotes: 'docs/release-notes/${{ github.event.pull_request.number }}.${{ needs.check-milestone.outputs.type }}.md'
relnotes: 'docs/release-notes/${{ github.event.pull_request.number }}.${{ (contains(github.event.pull_request.title, '!') && 'breaking') || needs.check-milestone.outputs.type }}.md'
Copy link
Copy Markdown
Contributor Author

@ilan-gold ilan-gold Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No better way to test/figure this out than a real PR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is basically the logic yeah!

- name: Check if a relevant release fragment is added
uses: flying-sheep/check@v1
with:
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/2367.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `Anndata.__{set,del}item__` {user}`ilan-gold`
28 changes: 0 additions & 28 deletions src/anndata/_core/anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,21 +1023,6 @@ def _normalize_indices(
) -> tuple[_Index1DNorm | int | np.integer, _Index1DNorm | int | np.integer]:
return _normalize_indices(index, self.obs_names, self.var_names)

# TODO: this is not quite complete...
def __delitem__(self, index: Index) -> None:
obs, var = self._normalize_indices(index)
# TODO: does this really work?
if not self.isbacked:
del self._X[obs, var]
else:
X = self.file["X"]
del X[obs, var]
self._set_backed("X", X)
if var == slice(None):
del self._obs.iloc[obs, :]
if obs == slice(None):
del self._var.iloc[var, :]

@overload
def __getitem__(self, index: AdRef) -> Array: ...
@overload
Expand Down Expand Up @@ -1206,19 +1191,6 @@ def _inplace_subset_obs(self, index: Index1D):

self._init_as_actual(adata_subset)

# TODO: Update, possibly remove
def __setitem__(self, index: Index, val: float | _XDataType):
if self.is_view:
msg = "Object is view and cannot be accessed with `[]`."
raise ValueError(msg)
obs, var = self._normalize_indices(index)
if not self.isbacked:
self._X[obs, var] = val
else:
X = self.file["X"]
X[obs, var] = val
self._set_backed("X", X)

def __len__(self) -> int:
return self.shape[0]

Expand Down
Loading