Skip to content

Switch to (testing.)fast-array-utils #1921

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

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Conversation

flying-sheep
Copy link
Member

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

@flying-sheep flying-sheep added this to the 0.12.0 milestone Mar 18, 2025
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.74%. Comparing base (ccfb6e3) to head (8ac2987).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1921      +/-   ##
==========================================
- Coverage   86.87%   84.74%   -2.14%     
==========================================
  Files          47       47              
  Lines        6912     6759     -153     
==========================================
- Hits         6005     5728     -277     
- Misses        907     1031     +124     
Files with missing lines Coverage Δ
src/anndata/_core/merge.py 84.06% <100.00%> (-9.95%) ⬇️
src/anndata/compat/__init__.py 78.18% <100.00%> (-5.00%) ⬇️
src/anndata/tests/helpers.py 89.08% <100.00%> (-2.81%) ⬇️
src/anndata/utils.py 85.56% <ø> (-1.43%) ⬇️

... and 10 files with indirect coverage changes

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

@flying-sheep flying-sheep changed the title Switch to testing.fast-array-utils Switch to (testing.)fast-array-utils Apr 1, 2025
Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

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

In general the amount of

@pytest.mark.array_type(skip=Flags.Gpu | Flags.Disk)

is a lot (both this one specifically, and others like it). It seems like there is probably some sort of default we could have, no?

@@ -115,10 +107,10 @@ def adata_orig(adata_remote_orig_with_path: tuple[Path, AnnData]) -> AnnData:
return orig


@pytest.fixture(scope="session")
@pytest.fixture
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be a source of some slowdown

@@ -74,11 +66,11 @@ def simple_subset_func(request):
return request.param


@pytest.fixture(scope="session")
@pytest.fixture
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto


assert init_hash == tokenize(adata)
assert isinstance(subset.X, type(adata.X))


@IGNORE_SPARSE_EFFICIENCY_WARNING
def test_set_scalar_subset_X(matrix_type, subset_func):
adata = ad.AnnData(matrix_type(np.zeros((10, 10))))
@pytest.mark.array_type(skip={Flags.Disk, *CUPY_SPARSE, *DASK_SPARRAY})
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this sort of thing will now run these tests on gpu whereas they did not before?

def test_not_set_subset_X_dask(matrix_type_no_gpu, subset_func):
adata = ad.AnnData(matrix_type_no_gpu(asarray(sparse.random(20, 20))))
@pytest.mark.array_type(skip=Flags.Gpu | Flags.Disk)
def test_not_set_subset_X_dask(array_type: ArrayType, subset_func) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, this runs on sparse etc. as well, no?

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