sgkit.save_dataset#

sgkit.save_dataset(ds, store, storage_options=None, auto_rechunk=None, zarr_format=2, **kwargs)#

Save a dataset to Zarr storage.

This function is a thin wrapper around xarray.Dataset.to_zarr() that uses sensible defaults and makes it easier to use in a pipeline.

Parameters:
ds Dataset

Dataset to save.

store StoreLike

Zarr store or path to directory in file system to save to.

storage_options Dict[str, str] | None (default: None)

Any additional parameters for the storage backend (see fsspec.open).

auto_rechunk bool | None (default: None)

If True, automatically rechunk the dataset to uniform chunks before saving, if necessary. This is required for Zarr, but can be expensive. Defaults to False.

zarr_format int (default: 2)

On-disk Zarr format, either 2 or 3. Defaults to 2 for compatibility with existing datasets, even though sgkit requires Zarr Python 3.

kwargs Any

Additional arguments to pass to xarray.Dataset.to_zarr().

Return type:

None