Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 6 additions & 0 deletions sgkit/io/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down