From d2a98c4ccfc829801d136b8cbfe6702622fd382e Mon Sep 17 00:00:00 2001 From: Zuolin Cheng Date: Wed, 2 Dec 2026 22:31:29 -0800 Subject: [PATCH 1/2] Document overwriting an existing Zarr dataset --- sgkit/io/dataset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sgkit/io/dataset.py b/sgkit/io/dataset.py index 514007202..634ec6308 100644 --- a/sgkit/io/dataset.py +++ b/sgkit/io/dataset.py @@ -19,6 +19,12 @@ def save_dataset( This function is a thin wrapper around :meth:`xarray.Dataset.to_zarr` that uses sensible defaults and makes it easier to use in a pipeline. + By default a save without an append dimension or region refuses to overwrite + an existing store. To replace the entire store, use + ``save_dataset(ds, "ds.zarr", mode="w")``. This removes variables in the store + that are absent from ``ds``. If ``ds`` is lazily loaded from the destination, + finish reading it into memory or choose a different destination before saving. + Parameters ---------- ds From e2cd7746f37d6e3e6e2d1120d3eb8f31b5cc1c4a Mon Sep 17 00:00:00 2001 From: Zuolin Cheng Date: Wed, 2 Dec 2026 22:31:29 -0800 Subject: [PATCH 2/2] docs: add the required changelog entry --- docs/changelog.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7f7a29eb0..7cc66666e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -83,8 +83,11 @@ Bug fixes matches the computed result, and correlation distances are no longer slightly negative. -.. Documentation -.. ~~~~~~~~~~~~~ +Documentation +~~~~~~~~~~~~~ + +- Explain how the ``mode`` argument controls whether ``save_dataset`` + replaces an existing Zarr store. .. _changelog.0.10.0: