Skip to content

Commit

Permalink
Merge branch 'main' into ig/cache_arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-gold authored Nov 11, 2024
2 parents b513217 + 7894073 commit 0cca2fe
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 58 deletions.
41 changes: 39 additions & 2 deletions docs/release-notes/0.11.0.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
(v0.11.0)=
### 0.11.0 {small}`2024-11-07`

Release candidates:

- (v0.11.0rc3)=
{guilabel}`rc3` 2024-10-14
- (v0.11.0rc2)=
{guilabel}`rc2` 2024-09-24
- (v0.11.0rc1)=
{guilabel}`rc1` 2024-09-04

#### Bug fixes

- Ensure {func}`anndata.concat` of {class}`~anndata.AnnData` object with {class}`scipy.sparse.spmatrix` and {class}`scipy.sparse.sparray` dask arrays uses the correct fill value of 0. {user}`ilan-gold` ({pr}`1719`)
- Ensure that views of AwkwardArrays have their "view" attributes removed on saving an {class}`~anndata.AnnData` object
to disk. {user}`grst` ({pr}`1736`)
- Ensure that views of AwkwardArrays have their "view" attributes removed on saving an {class}`~anndata.AnnData` object to disk. {user}`grst` ({pr}`1736`)

#### Breaking changes

- {guilabel}`rc3` Drop support for `python` 3.9 {user}`ilan-gold` ({pr}`1712`)
- {guilabel}`rc2` A new `anndata.io` module contains all `read_*` and `write_*` functions, and all imports of such functions should go through this module. Old ways of importing these functions i.e., `from anndata import read_csv` or `from anndata._io.specs import read_elem` will still work, but are now considered deprecated and give a warning on import with the exception of {func}`anndata.io.read_zarr` and {func}`anndata.io.read_h5ad`, which will remain at the top-level `anndata` without warning. {user}`ilan-gold ({pr}`1682`)
- {guilabel}`rc1` Removed deprecated modules `anndata.core` and `anndata.readwrite` {user}`ivirshup` ({pr}`1197`)
- {guilabel}`rc1` No longer export `sparse_dataset` from `anndata.experimental`, instead exporting {func}`anndata.io.sparse_dataset` {user}`ilan-gold` ({pr}`1642`)
- {guilabel}`rc1` Move `RWAble` and `InMemoryElem` out of `experimental`, renaming `RWAble` to {type}`~anndata.typing.AxisStorable` and `InMemoryElem` to {type}`~anndata.typing.RWAble` {user}`ilan-gold` ({pr}`1643`)

#### Development Process

- {guilabel}`rc2` Add extra `dask` dependency for installation i.e., `pip install anndata[dask]` {user}`ilan-gold` ({pr}`1677`)
- {guilabel}`rc2` Remove `shall_` from variable names in `settings` {user}`ilan-gold` ({pr}`1685`)
- {guilabel}`rc1` Create new `cupy` installation options for cuda 11 & 12 called `cu11` and `cu12` {user}`Intron7` ({pr}`1596`)

#### Documentation

- {guilabel}`rc1` Correct {attr}`anndata.AnnData.X` type to include {class}`~anndata.abc.CSRDataset` and {class}`~anndata.abc.CSCDataset` as possible types and being deprecation process for non-csr/csc {class}`scipy.sparse.spmatrix` types in {attr}`anndata.AnnData.X` {user}`ilan-gold` ({pr}`1616`)

#### Features

- Add support for ellipsis indexing of the {class}`~anndata.AnnData` object {user}`ilan-gold` ({pr}`1729`)
- {guilabel}`rc1` `scipy.sparse.csr_array` and `scipy.sparse.csc_array` are now supported when constructing `AnnData` objects {user}`ilan-gold` {user}`isaac-virshup` ({pr}`1028`)
- {guilabel}`rc1` Allow `axis` parameter of e.g. {func}`anndata.concat` to accept `'obs'` and `'var'` {user}`flying-sheep` ({pr}`1244`)
- {guilabel}`rc1` Add `settings` object with methods for altering internally-used options, like checking for uniqueness on `obs`' index {user}`ilan-gold` ({pr}`1270`)
- {guilabel}`rc1` Add {attr}`~anndata.settings.remove_unused_categories` option to {attr}`anndata.settings` to override current behavior {user}`ilan-gold` ({pr}`1340`)
- {guilabel}`rc1` Add {func}`~anndata.experimental.read_elem_as_dask` function to handle i/o with sparse and dense arrays {user}`ilan-gold` ({pr}`1469`)
- {guilabel}`rc1` Add ability to convert strings to categoricals on write in {meth}`~anndata.AnnData.write_h5ad` and {meth}`~anndata.AnnData.write_zarr` via `convert_strings_to_categoricals` parameter {user}` falexwolf` ({pr}`1474`)
- {guilabel}`rc1` Add {attr}`~anndata.settings.check_uniqueness` option to {attr}`anndata.settings` to override current behavior {user}`ilan-gold` ({pr}`1507`)
- {guilabel}`rc1` Add functionality to write from GPU {class}`dask.array.Array` to disk {user}`ilan-gold` ({pr}`1550`)
- {guilabel}`rc1` Read and write support for nullable string arrays ({class}`pandas.arrays.StringArray`). Use pandas’ {doc}`pandas:user_guide/options` `mode.string_storage` to control which storage mode is used when reading `dtype="string"` columns. {user}`flying-sheep` ({pr}`1558`)
- {guilabel}`rc1` Export {func}`~anndata.io.write_elem` and {func}`~anndata.io.read_elem` directly from the main package instead of `experimental` {user}`ilan-gold` ({pr}`1598`)
- {guilabel}`rc1` Allow reading sparse data (via {func}`~anndata.io.read_elem` or {func}`~anndata.io.sparse_dataset`) into either {class}`scipy.sparse.csr_array` or {class}`scipy.sparse.csc_array` via {attr}`anndata.settings.use_sparse_array_on_read` {user}`ilan-gold` ({pr}`1633`)
32 changes: 0 additions & 32 deletions docs/release-notes/0.11.0rc1.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/release-notes/0.11.0rc2.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/release-notes/0.11.0rc3.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/release-notes/1725.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Remove upper pin on `dask` and exclude versions broken with sparse indexing {user}`ilan-gold`
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ gpu = ["cupy"]
cu12 = ["cupy-cuda12x"]
cu11 = ["cupy-cuda11x"]
# https://github.com/dask/dask/issues/11290
dask = ["dask[array]>=2022.09.2,<2024.8.0"]
dask = ["dask[array]>=2022.09.2,!=2024.8.*,!=2024.9.*"]

[tool.hatch.version]
source = "vcs"
Expand Down Expand Up @@ -181,6 +181,7 @@ select = [
"ICN", # Follow import conventions
"PTH", # Pathlib instead of os.path
"PT", # Pytest conventions
"PYI", # Typing
]
ignore = [
# line too long -> we accept long comment lines; formatter gets rid of long code lines
Expand Down
4 changes: 1 addition & 3 deletions src/anndata/_core/anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,7 @@ def _inplace_subset_obs(self, index: Index1D):
self._init_as_actual(adata_subset)

# TODO: Update, possibly remove
def __setitem__(
self, index: Index, val: int | float | np.ndarray | sparse.spmatrix
):
def __setitem__(self, index: Index, val: float | np.ndarray | sparse.spmatrix):
if self.is_view:
raise ValueError("Object is view and cannot be accessed with `[]`.")
obs, var = self._normalize_indices(index)
Expand Down
4 changes: 3 additions & 1 deletion src/anndata/_io/specs/lazy_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def read_h5_array(
shape = tuple(elem.shape)
dtype = elem.dtype
chunks: tuple[int, ...] = (
tuple(c if c not in {None, -1} else shape[i] for i, c in enumerate(chunks))
tuple(
c if c not in {None, -1} else s for c, s in zip(chunks, shape, strict=True)
)
if chunks is not None
else (_DEFAULT_STRIDE,) * len(shape)
)
Expand Down
3 changes: 3 additions & 0 deletions src/anndata/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"ArrayStorageType",
"GroupStorageType",
"StorageType",
"_ReadInternal",
"_ReadDaskInternal",
"_WriteInternal",
]

ArrayStorageType: TypeAlias = ZarrArray | H5Array
Expand Down
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
from functools import partial
from typing import TYPE_CHECKING

import dask
import joblib
import pytest
from dask.base import normalize_seq, normalize_token, tokenize
from dask.base import normalize_token, tokenize
from packaging.version import Version

if Version(dask.__version__) < Version("2024.8.0"):
from dask.base import normalize_seq
else:
from dask.tokenize import normalize_seq
from scipy import sparse

import anndata as ad
Expand Down

0 comments on commit 0cca2fe

Please sign in to comment.