From faf46899186280486d75bec19af2bc79cbef9e41 Mon Sep 17 00:00:00 2001 From: Daniel McDonald Date: Sat, 3 Oct 2026 08:41:30 -0600 Subject: [PATCH 1/2] MAINT: build Python 3.14 wheels #1004 upgraded cibuildwheel to a version that supports 3.14, but the build selector in pyproject.toml still listed cp39-cp313, so no cp314 wheels were produced. Add cp314-* to the selector. Also note the in1d -> isin fix (#1003) in the ChangeLog. Co-Authored-By: Claude Opus 5.5 --- ChangeLog.md | 5 +++++ pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8998957a..175724f8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,11 @@ 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) + +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/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 "] From 3d5630f111f51ba7f735ef78364c2798bb2a89f7 Mon Sep 17 00:00:00 2001 From: Daniel McDonald Date: Sat, 3 Oct 2026 08:51:57 -0600 Subject: [PATCH 2/2] BUG: to_anndata fails with anndata >= 0.13 anndata 0.13.0 removed the dtype argument to AnnData(), so Table.to_anndata() raised TypeError. Cast the matrix before constructing the AnnData object instead. This also removes the FutureWarning older anndata versions emitted for dtype=. Co-Authored-By: Claude Opus 5.5 --- ChangeLog.md | 1 + biom/table.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 175724f8..88f3e569 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,7 @@ 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: 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()