From 5e9c99cd9e3fd114a3d00e88ebfc6ec3fd3976d9 Mon Sep 17 00:00:00 2001 From: Lukas Heumos Date: Wed, 4 Nov 2026 10:26:00 +0100 Subject: [PATCH] Make scCODA results writable to h5mu arviz 1.x returns az.summary as arviz_stats' SummaryDataFrame, a pandas subclass that survives .loc and .copy, so intercept_df and the effect_df_* frames stored in varm had no anndata writer. The numpy_nullable conversion additionally turned the float64 summary columns into Float64 extension arrays, which anndata cannot write either. summary_prepare now returns plain float64 DataFrames; the values are unchanged. Verified by writing and reading back a sampled haber_2017_regions MuData, which failed on main with arviz 1.3.0 and arviz-stats 1.3.3. --- src/pertpy/tools/_coda/_base_coda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pertpy/tools/_coda/_base_coda.py b/src/pertpy/tools/_coda/_base_coda.py index e3fda2f2..ecc53386 100644 --- a/src/pertpy/tools/_coda/_base_coda.py +++ b/src/pertpy/tools/_coda/_base_coda.py @@ -575,7 +575,7 @@ def summary_prepare( kind="stats", **kwargs, ) - summ = summ.convert_dtypes(dtype_backend="numpy_nullable").infer_objects() + summ = pd.DataFrame(summ) # az.summary orders rows by var_names then C-order of each variable's dims, matching values.flatten(), so align the medians positionally. posterior = arviz_data["posterior"].to_dataset()