MCPcopy Index your code
hub / github.com/dask/dask / test_tiledb_roundtrip

Function test_tiledb_roundtrip

dask/array/tests/test_array_core.py:5324–5355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5322
5323
5324def test_tiledb_roundtrip():
5325 tiledb = pytest.importorskip("tiledb")
5326 # 1) load with default chunking
5327 # 2) load from existing tiledb.DenseArray
5328 # 3) write to existing tiledb.DenseArray
5329 rng = da.random.default_rng()
5330 a = rng.random((3, 3))
5331 with tmpdir() as uri:
5332 da.to_tiledb(a, uri)
5333 tdb = da.from_tiledb(uri)
5334
5335 assert_eq(a, tdb)
5336 assert a.chunks == tdb.chunks
5337
5338 # from tiledb.array
5339 with tiledb.open(uri) as t:
5340 tdb2 = da.from_tiledb(t)
5341 assert_eq(a, tdb2)
5342
5343 with tmpdir() as uri2:
5344 with tiledb.empty_like(uri2, a) as t:
5345 a.to_tiledb(t)
5346 assert_eq(da.from_tiledb(uri2), a)
5347
5348 # specific chunking
5349 with tmpdir() as uri:
5350 a = rng.random((3, 3), chunks=(1, 1))
5351 a.to_tiledb(uri)
5352 tdb = da.from_tiledb(uri)
5353
5354 assert_eq(a, tdb)
5355 assert a.chunks == tdb.chunks
5356
5357
5358def test_tiledb_multiattr():

Callers

nothing calls this directly

Calls 4

tmpdirFunction · 0.90
assert_eqFunction · 0.90
to_tiledbMethod · 0.80
randomMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…