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

Method test_persist

xarray/tests/test_dask.py:419–431  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

417 assert ((u + 1).data == v2.data).all()
418
419 def test_persist(self):
420 u = self.eager_array
421 v = self.lazy_array + 1
422
423 (v2,) = dask.persist(v)
424 assert v is not v2
425 assert len(v2.__dask_graph__()) < len(v.__dask_graph__())
426 assert v2.__dask_keys__() == v.__dask_keys__()
427 assert dask.is_dask_collection(v)
428 assert dask.is_dask_collection(v2)
429
430 self.assertLazyAndAllClose(u + 1, v)
431 self.assertLazyAndAllClose(u + 1, v2)
432
433 def test_concat_loads_variables(self):
434 # Test that concat() computes not-in-memory variables at most once

Callers

nothing calls this directly

Calls 4

assertLazyAndAllCloseMethod · 0.95
persistMethod · 0.45
__dask_graph__Method · 0.45
__dask_keys__Method · 0.45

Tested by

no test coverage detected