Skip to content

(fix): setting on Dataset2D "just works" (like Dataframes) and is thoroughly checked #1992

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 10 commits into
base: main
Choose a base branch
from

Conversation

ilan-gold
Copy link
Contributor

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

Since we're enforcing two dimensions on the object (in theory), we should probably be super clear about that while also retaining dataframe-like operations i.e., when you try to "set a column" (in this case, xarray data variable that isn't a coord), it "just works" (sets the column and doesn't do anything else). This behavior matches that of pandas in so far as having a named index doesn't mean it can be set/accessed via df["my_named_index"]

I think there are probably other horrifying ways to invalidate this constraint, so I will try to comb through the xarray docs to fix these separately, but trying to keep this scoped to the issue for now

@ilan-gold ilan-gold changed the title (fix): setting on Dataset2D "just works" (fix): setting on Dataset2D "just works" and is thoroughly checked May 16, 2025
@ilan-gold ilan-gold added this to the 0.12.0 milestone May 16, 2025
@ilan-gold ilan-gold changed the title (fix): setting on Dataset2D "just works" and is thoroughly checked (fix): setting on Dataset2D "just works" (like Dataframes) and is thoroughly checked May 16, 2025
Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.11%. Comparing base (ec65081) to head (279e524).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1992      +/-   ##
==========================================
- Coverage   87.11%   85.11%   -2.00%     
==========================================
  Files          46       46              
  Lines        6947     6968      +21     
==========================================
- Hits         6052     5931     -121     
- Misses        895     1037     +142     
Files with missing lines Coverage Δ
src/anndata/_core/merge.py 85.06% <100.00%> (-8.89%) ⬇️
src/anndata/_core/xarray.py 98.05% <100.00%> (+0.43%) ⬆️

... and 6 files with indirect coverage changes

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

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.

Fix setting on Dataset2D without specificed coord
1 participant