Skip to content

fix!: remove __delitem__ and __setitem__ from the AnnData object#2367

Open
ilan-gold wants to merge 8 commits intomainfrom
ig/del_set_item
Open

fix!: remove __delitem__ and __setitem__ from the AnnData object#2367
ilan-gold wants to merge 8 commits intomainfrom
ig/del_set_item

Conversation

@ilan-gold
Copy link
Contributor

@ilan-gold ilan-gold commented Mar 18, 2026

Towards making backed mode simpler, we remove these two methods

  • Release note not necessary because:

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.60%. Comparing base (753f058) to head (91df208).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2367      +/-   ##
==========================================
- Coverage   87.36%   85.60%   -1.76%     
==========================================
  Files          49       49              
  Lines        7787     7766      -21     
==========================================
- Hits         6803     6648     -155     
- Misses        984     1118     +134     
Files with missing lines Coverage Δ
src/anndata/_core/anndata.py 85.47% <ø> (+2.12%) ⬆️

... and 8 files with indirect coverage changes

@ilan-gold ilan-gold added this to the 0.13.0 milestone Mar 18, 2026
@ilan-gold ilan-gold changed the title fix!: remove __delitem__ and __setitem__ from the AnnData object breaking: remove __delitem__ and __setitem__ from the AnnData object Mar 18, 2026
@ilan-gold ilan-gold changed the title breaking: remove __delitem__ and __setitem__ from the AnnData object fix!: remove __delitem__ and __setitem__ from the AnnData object Mar 18, 2026
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
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
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!

Copy link
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

good call!

This gets rid of del adata[cells, :] in favor of adata = adata[~adata.obs_names.isin(cells), :].copy(), which is less elegant, but possibly niche enough that facilitating it isn’t necessary.

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
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants