Skip to content

(feat): composable API for xarray dataset #1997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

ilan-gold
Copy link
Contributor

@ilan-gold ilan-gold commented May 27, 2025

Following up on a conversation with Luca, a composable API is like both more maintainable and more explainable. It also represents a concrete step towards something like #1111. This PR represents a first step as it forces us to more clearly enumerate the methods needed for internal compatibility that were hidden by subclassing from Dataset i.e., copy and reindex

  • Closes #
  • Tests added
  • Release note added (or unnecessary)

@ilan-gold ilan-gold changed the title (feat): composable API for dataframes (feat): composable API for xarray dataset May 27, 2025
Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 96.89922% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.21%. Comparing base (fc892b3) to head (6a57a26).

Files with missing lines Patch % Lines
src/anndata/_core/xarray.py 96.87% 3 Missing ⚠️
src/anndata/_core/storage.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1997      +/-   ##
==========================================
- Coverage   87.14%   85.21%   -1.94%     
==========================================
  Files          46       46              
  Lines        6986     7033      +47     
==========================================
- Hits         6088     5993      -95     
- Misses        898     1040     +142     
Files with missing lines Coverage Δ
src/anndata/_core/aligned_mapping.py 95.18% <100.00%> (ø)
src/anndata/_core/merge.py 85.03% <100.00%> (-8.94%) ⬇️
src/anndata/_io/specs/lazy_methods.py 96.05% <100.00%> (ø)
src/anndata/_io/specs/registry.py 93.68% <ø> (-0.53%) ⬇️
src/anndata/experimental/backed/__init__.py 100.00% <100.00%> (ø)
src/anndata/_core/storage.py 97.61% <50.00%> (ø)
src/anndata/_core/xarray.py 97.75% <96.87%> (-0.54%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from ig/setting_on_dataset to main June 2, 2025 13:46
@ilan-gold ilan-gold added this to the 0.12.0 milestone Jun 2, 2025
@ilan-gold ilan-gold marked this pull request as ready for review June 3, 2025 08:31
@ilan-gold ilan-gold requested a review from flying-sheep June 3, 2025 09:11
@ilan-gold ilan-gold self-assigned this Jun 5, 2025
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.

There are a bunch of documentation issues, otherwise it looks fine!

please go through every single documented item and make sure the docs look right, there is broken syntax in some.

docs/conf.py Outdated
Comment on lines 96 to 103
nitpick_ignore_regex = [
# See https://github.com/python/cpython/blob/7775d93e2d142ab66c7d8fa7cff068b2522a37b0/Lib/_collections_abc.py#L792-L817
# for why these are necessary.
# The docstrings are just normal strings and thus misinterpreted.
# TODO: revert once this is resolved in python.
("py:class", ".*d defaults to None.*"),
("py:class", "a.*object providing.*a view on D.*"),
]
Copy link
Member

Choose a reason for hiding this comment

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

The fact that these strings end up in our docs at all is the problem, so instead of ignoring errors arising from that, please prevent the source of the issue

Suggested change
nitpick_ignore_regex = [
# See https://github.com/python/cpython/blob/7775d93e2d142ab66c7d8fa7cff068b2522a37b0/Lib/_collections_abc.py#L792-L817
# for why these are necessary.
# The docstrings are just normal strings and thus misinterpreted.
# TODO: revert once this is resolved in python.
("py:class", ".*d defaults to None.*"),
("py:class", "a.*object providing.*a view on D.*"),
]

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