Skip to content

Commit a056bd8

Browse files
wasadeclaude
andauthored
MAINT: build Python 3.14 wheels; fix to_anndata for anndata 0.13 (#1005)
* 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0f3855c commit a056bd8

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎ChangeLog.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ biom-2.1.18-dev
77
Bug fixes:
88

99
* 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)
10+
* `np.in1d` was removed in NumPy 2.4, replaced with `np.isin`. See issue [#1003](https://github.com/biocore/biom-format/issues/1003)
11+
* `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)
12+
13+
General Maintenance:
14+
15+
* 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)
1016

1117
biom-2.1.17
1218
-----------

‎biom/table.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4397,10 +4397,13 @@ def to_anndata(self, dense=False, dtype="float32", transpose=True):
43974397
if dense:
43984398
mat = mat.toarray()
43994399

4400+
# anndata 0.13 removed the AnnData(dtype=...) argument
4401+
mat = mat.astype(dtype)
4402+
44004403
var = self.metadata_to_dataframe("sample")
44014404
obs = self.metadata_to_dataframe("observation")
44024405

4403-
adata = anndata.AnnData(mat, obs=obs, var=var, dtype=dtype)
4406+
adata = anndata.AnnData(mat, obs=obs, var=var)
44044407
# Convention for scRNA-seq analysis in Python
44054408
adata = adata.transpose()
44064409

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test-requires = ["pytest", "numpy"]
8484
skip = ["*-win32", "*-manylinux_i686", "pp*", "*-musllinux*"]
8585

8686
# Python versions to build
87-
build = "cp39-* cp310-* cp311-* cp312-* cp313-*"
87+
build = "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
8888

8989
[tool.pytest.ini_options]
9090
addopts = ["--ignore=biom/assets/exercise_api.py "]

0 commit comments

Comments
 (0)