Skip to content

(fix): check xarray installation when using any xarray-dependent code #1991

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

Conversation

ilan-gold
Copy link
Contributor

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

  • Closes: QOL issue
  • Tests added
  • Release note added (or unnecessary)

@ilan-gold ilan-gold added this to the 0.12.0 milestone May 16, 2025
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 98.76543% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.34%. Comparing base (cbdbb14) to head (e770b69).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/anndata/compat/__init__.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1991      +/-   ##
==========================================
- Coverage   87.11%   85.34%   -1.78%     
==========================================
  Files          46       46              
  Lines        6947     7001      +54     
==========================================
- Hits         6052     5975      -77     
- Misses        895     1026     +131     
Files with missing lines Coverage Δ
src/anndata/_core/merge.py 85.06% <100.00%> (-8.89%) ⬇️
src/anndata/_core/xarray.py 98.43% <100.00%> (+0.81%) ⬆️
src/anndata/_io/specs/lazy_methods.py 96.12% <100.00%> (+0.07%) ⬆️
src/anndata/_io/zarr.py 84.78% <100.00%> (ø)
src/anndata/experimental/backed/_io.py 96.15% <100.00%> (+5.24%) ⬆️
src/anndata/tests/helpers.py 82.91% <100.00%> (-10.24%) ⬇️
src/anndata/compat/__init__.py 80.64% <75.00%> (+4.11%) ⬆️

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

@ilan-gold
Copy link
Contributor Author

The codecov is complaining because we need a similar fix to scverse/scanpy#3607 (comment) where we have "min-deps" i.e., no xarray dask etc.

@ilan-gold ilan-gold requested a review from flying-sheep May 23, 2025 11:08
@ilan-gold ilan-gold changed the title (fix): check xarray installation when reading in a dataframe (fix): check xarray installation when reading in any xarray-dependent code May 23, 2025
@flying-sheep
Copy link
Member

Yeah! Would you do the equivalent PR to scverse/scanpy#3607 or should I?

@ilan-gold
Copy link
Contributor Author

I'm happy to do it @flying-sheep.

@@ -15,7 +15,7 @@ scripts.clean = "git restore --source=HEAD --staged --worktree -- docs/release-n

[envs.hatch-test]
default-args = [ ]
features = [ "dev", "test-min" ]
features = [ "test-min" ]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dev was installing test which was installing xarray, so I removed it. I couldn't see a reason to have it, but it's possible there is some sort of unknown use-case for it (to me)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this was also a pretty big whif on our test suite since we weren't testing without xarray

@ilan-gold ilan-gold force-pushed the ig/error_on_read_elem_lazy branch from 118a304 to 1f91433 Compare June 3, 2025 12:53
@ilan-gold ilan-gold changed the title (fix): check xarray installation when reading in any xarray-dependent code (fix): check xarray installation when using any xarray-dependent code Jun 3, 2025
@ilan-gold ilan-gold requested review from flying-sheep and removed request for flying-sheep June 4, 2025 09:23
@ilan-gold
Copy link
Contributor Author

The awkward array docs are down (?) so we'll just rerun tomorrow

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