Skip to content

chore: add load_all_aligned but only warn initially#251

Open
selmanozleyen wants to merge 24 commits into
scverse:mainfrom
selmanozleyen:chore/load-all-warn
Open

chore: add load_all_aligned but only warn initially#251
selmanozleyen wants to merge 24 commits into
scverse:mainfrom
selmanozleyen:chore/load-all-warn

Conversation

@selmanozleyen

Copy link
Copy Markdown
Member

My goal is to first warn users when their adata has more than .X in add_adata. It will warn saying they should use the old load function if they want to keep the old behavior. Otherwise in next release, we can go on with also yielding obsm and layers.

Warning: docstring explanation is written and prettified with AI

@selmanozleyen selmanozleyen requested a review from ilan-gold July 13, 2026 07:26
@selmanozleyen selmanozleyen self-assigned this Jul 13, 2026
@selmanozleyen selmanozleyen added the skip-gpu-ci Whether gpu ci should be skipped label Jul 13, 2026
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.70%. Comparing base (56127d5) to head (e58e12c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #251      +/-   ##
==========================================
- Coverage   93.43%   91.70%   -1.74%     
==========================================
  Files          15       15              
  Lines        1432     1446      +14     
==========================================
- Hits         1338     1326      -12     
- Misses         94      120      +26     
Files with missing lines Coverage Δ
src/annbatch/loader.py 88.08% <100.00%> (-2.84%) ⬇️
src/annbatch/utils.py 81.19% <100.00%> (-7.59%) ⬇️

... and 2 files with indirect coverage changes

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

@selmanozleyen selmanozleyen changed the title only warn initially chore: add load_all_aligned but only warn initially Jul 13, 2026
Comment thread src/annbatch/utils.py Outdated
Comment thread src/annbatch/loader.py Outdated
@selmanozleyen selmanozleyen requested a review from ilan-gold July 14, 2026 12:13
Comment thread src/annbatch/loader.py Outdated
Comment thread pyproject.toml Outdated
Comment thread tests/test_dataset.py Outdated
Comment thread tests/test_dataset.py Outdated
@selmanozleyen selmanozleyen requested a review from ilan-gold July 14, 2026 14:17
Comment thread src/annbatch/loader.py Outdated
Comment thread src/annbatch/utils.py
Comment thread tests/test_dataset.py Outdated
Comment thread tests/test_dataset.py
Comment thread src/annbatch/utils.py Outdated
@selmanozleyen selmanozleyen requested a review from ilan-gold July 15, 2026 13:22
Comment thread src/annbatch/utils.py
Comment on lines +289 to 293
warn_ignored_obs_aligned(
[f"{elem}/{key}" for elem in ("obsm", "obsp", "layers") if elem in g for key in g[elem]],
stacklevel=2,
)
var = g["var"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to keep this here if it's called in _add_adata_unchecked?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But there are other checks in that function. That function only doesn't check n_obs to avoid sampler.validate.

Comment thread src/annbatch/loader.py
return self

def _add_adata_unchecked(self, adata: ad.AnnData) -> Self:
warn_ignored_obs_aligned(obs_aligned_extras(adata), stacklevel=3)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any reason not to just move obs_aligned_extras's call of adata into warn_ignored_obs_aligned? IT's in the name of warn_ignored_obs_aligned after all

@selmanozleyen selmanozleyen Jul 15, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I saw it as something to reuse once we have the loading functionality. Can also inline it if you want

Comment thread tests/test_dataset.py Outdated
Comment thread tests/test_dataset.py Outdated
Comment thread tests/test_dataset.py Outdated
Comment thread tests/test_dataset.py Outdated
selmanozleyen and others added 6 commits July 15, 2026 17:01
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-ci Whether gpu ci should be skipped

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants