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

Function dump_to_store

xarray/backends/writers.py:469–491  ·  view source on GitHub ↗

Store dataset contents to a backends.*DataStore object.

(
    dataset, store, writer=None, encoder=None, encoding=None, unlimited_dims=None
)

Source from the content-addressed store, hash-verified

467
468
469def dump_to_store(
470 dataset, store, writer=None, encoder=None, encoding=None, unlimited_dims=None
471):
472 """Store dataset contents to a backends.*DataStore object."""
473 if writer is None:
474 writer = ArrayWriter()
475
476 if encoding is None:
477 encoding = {}
478
479 variables, attrs = conventions.encode_dataset_coordinates(dataset)
480
481 check_encoding = set()
482 for k, enc in encoding.items():
483 # no need to shallow copy the variable again; that already happened
484 # in encode_dataset_coordinates
485 variables[k].encoding = enc
486 check_encoding.add(k)
487
488 if encoder:
489 variables, attrs = encoder(variables, attrs)
490
491 store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)
492
493
494def save_mfdataset(

Callers 5

dump_to_storeMethod · 0.90
to_netcdfFunction · 0.85
to_zarrFunction · 0.85
_datatree_to_netcdfFunction · 0.85
_datatree_to_zarrFunction · 0.85

Calls 4

ArrayWriterClass · 0.90
itemsMethod · 0.80
addMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…