diff --git a/ChangeLog.md b/ChangeLog.md index 8998957a..88f3e569 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,12 @@ biom-2.1.18-dev Bug fixes: * A regression with parse of UTF-8 characters was introduced, reported [here](https://forum.qiime2.org/t/feature-table-gives-ascii-codec-cant-decode-byte-0xc3-in-position-4-error/33858/7) +* `np.in1d` was removed in NumPy 2.4, replaced with `np.isin`. See issue [#1003](https://github.com/biocore/biom-format/issues/1003) +* `Table.to_anndata` failed with anndata >= 0.13, which removed the `dtype` argument to `AnnData`. The matrix is now cast prior to construction. See PR [#1005](https://github.com/biocore/biom-format/pull/1005) + +General Maintenance: + +* Python 3.14 added to CI and wheels are now built for Python 3.14. See PR [#1004](https://github.com/biocore/biom-format/pull/1004) biom-2.1.17 ----------- diff --git a/biom/table.py b/biom/table.py index 9f352892..c7a69601 100644 --- a/biom/table.py +++ b/biom/table.py @@ -4397,10 +4397,13 @@ def to_anndata(self, dense=False, dtype="float32", transpose=True): if dense: mat = mat.toarray() + # anndata 0.13 removed the AnnData(dtype=...) argument + mat = mat.astype(dtype) + var = self.metadata_to_dataframe("sample") obs = self.metadata_to_dataframe("observation") - adata = anndata.AnnData(mat, obs=obs, var=var, dtype=dtype) + adata = anndata.AnnData(mat, obs=obs, var=var) # Convention for scRNA-seq analysis in Python adata = adata.transpose() diff --git a/pyproject.toml b/pyproject.toml index 7b1b9954..67532d04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ test-requires = ["pytest", "numpy"] skip = ["*-win32", "*-manylinux_i686", "pp*", "*-musllinux*"] # Python versions to build -build = "cp39-* cp310-* cp311-* cp312-* cp313-*" +build = "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" [tool.pytest.ini_options] addopts = ["--ignore=biom/assets/exercise_api.py "]