MCPcopy
hub / github.com/pydata/xarray / sync

Method sync

xarray/backends/common.py:409–432  ·  view source on GitHub ↗
(self, compute=True, chunkmanager_store_kwargs=None)

Source from the content-addressed store, hash-verified

407 target[...] = source
408
409 def sync(self, compute=True, chunkmanager_store_kwargs=None):
410 if self.sources:
411 chunkmanager = get_chunked_array_type(*self.sources)
412
413 # TODO: consider wrapping targets with dask.delayed, if this makes
414 # for any discernible difference in performance, e.g.,
415 # targets = [dask.delayed(t) for t in self.targets]
416
417 if chunkmanager_store_kwargs is None:
418 chunkmanager_store_kwargs = {}
419
420 delayed_store = chunkmanager.store(
421 self.sources,
422 self.targets,
423 lock=self.lock,
424 compute=compute,
425 flush=True,
426 regions=self.regions,
427 **chunkmanager_store_kwargs,
428 )
429 self.sources = []
430 self.targets = []
431 self.regions = []
432 return delayed_store
433
434
435class AbstractWritableDataStore(AbstractDataStore):

Callers 4

to_netcdfFunction · 0.95
to_zarrFunction · 0.95
_datatree_to_netcdfFunction · 0.95
_datatree_to_zarrFunction · 0.95

Calls 2

get_chunked_array_typeFunction · 0.90
storeMethod · 0.45

Tested by

no test coverage detected