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
str
|Path
|MutableMapping
[str
,bytes
]Union
[str
,Path
,MutableMapping
[str
,bytes
]] Zarr store or path to directory in file system to save to.
- storage_options {
str
:str
} |None
Optional
[Dict
[str
,str
]] (default:None
) Any additional parameters for the storage backend (see
fsspec.open
).- auto_rechunk
bool
|None
Optional
[bool
] (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.
- kwargs
Any
Additional arguments to pass to
xarray.Dataset.to_zarr()
.
- ds
- Return type: