diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 839b59014..a2c99c597 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -61,7 +61,7 @@ jobs: condition: eq(variables['DEPENDENCIES_VERSION'], 'minimum') - script: | - uv pip install --system --compile --pre "anndata[dev,test] @ ." "scanpy>=1.10.0rc1" + uv pip install -v --system --compile --pre "anndata[dev,test] @ ." "scanpy>=1.10.0rc1" displayName: "Install dependencies release candidates" condition: eq(variables['DEPENDENCIES_VERSION'], 'pre-release') diff --git a/anndata/_core/index.py b/anndata/_core/index.py index bdf1bfe27..38c2cdede 100644 --- a/anndata/_core/index.py +++ b/anndata/_core/index.py @@ -147,15 +147,10 @@ def _subset(a: np.ndarray | pd.DataFrame, subset_idx: Index): @_subset.register(DaskArray) def _subset_dask(a: DaskArray, subset_idx: Index): - if all(isinstance(x, cabc.Iterable) for x in subset_idx): + if len(subset_idx) > 1 and all(isinstance(x, cabc.Iterable) for x in subset_idx): if isinstance(a._meta, csc_matrix): return a[:, subset_idx[1]][subset_idx[0], :] - elif isinstance(a._meta, spmatrix): - return a[subset_idx[0], :][:, subset_idx[1]] - else: - # TODO: this may have been working for some cases? - subset_idx = np.ix_(*subset_idx) - return a.vindex[subset_idx] + return a[subset_idx[0], :][:, subset_idx[1]] return a[subset_idx] diff --git a/docs/release-notes/0.10.7.md b/docs/release-notes/0.10.7.md index ea1929040..2896ba5ca 100644 --- a/docs/release-notes/0.10.7.md +++ b/docs/release-notes/0.10.7.md @@ -10,3 +10,5 @@ ```{rubric} Performance ``` + +* Remove `vindex` for subsetting `dask.array.Array` because of its slowness and memory consumption {user} `ilan-gold` {pr}`1432`