MCPcopy Index your code
hub / github.com/pydata/xarray / to_netcdf

Function to_netcdf

xarray/backends/writers.py:247–261  ·  view source on GitHub ↗
(
    dataset: Dataset,
    path_or_file: str | os.PathLike | None = None,
    mode: NetcdfWriteModes = "w",
    format: T_NetcdfTypes | None = None,
    group: str | None = None,
    engine: T_NetcdfEngine | None = None,
    encoding: Mapping[Hashable, Mapping[str, Any]] | None = None,
    unlimited_dims: Iterable[Hashable] | None = None,
    compute: bool = True,
    *,
    multifile: Literal[True],
    invalid_netcdf: bool = False,
    auto_complex: bool | None = None,
)

Source from the content-addressed store, hash-verified

245# multifile=True returns writer and datastore
246@overload
247def to_netcdf(
248 dataset: Dataset,
249 path_or_file: str | os.PathLike | None = None,
250 mode: NetcdfWriteModes = "w",
251 format: T_NetcdfTypes | None = None,
252 group: str | None = None,
253 engine: T_NetcdfEngine | None = None,
254 encoding: Mapping[Hashable, Mapping[str, Any]] | None = None,
255 unlimited_dims: Iterable[Hashable] | None = None,
256 compute: bool = True,
257 *,
258 multifile: Literal[True],
259 invalid_netcdf: bool = False,
260 auto_complex: bool | None = None,
261) -> tuple[ArrayWriter, AbstractDataStore]: ...
262
263
264# path=None writes to bytes or memoryview, depending on store

Callers 3

to_netcdfMethod · 0.90
to_netcdfMethod · 0.90
save_mfdatasetFunction · 0.85

Calls 15

syncMethod · 0.95
getbufferMethod · 0.95
BytesIOProxyClass · 0.90
ArrayWriterClass · 0.90
_normalize_pathFunction · 0.85
_validate_dataset_namesFunction · 0.85
_validate_attrsFunction · 0.85
_sanitize_unlimited_dimsFunction · 0.85
_get_netcdf_autocloseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…