MCPcopy
hub / github.com/dask/dask / test_tiledb_multiattr

Function test_tiledb_multiattr

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

Source from the content-addressed store, hash-verified

5356
5357
5358def test_tiledb_multiattr():
5359 tiledb = pytest.importorskip("tiledb")
5360 dom = tiledb.Domain(
5361 tiledb.Dim("x", (0, 1000), tile=100), tiledb.Dim("y", (0, 1000), tile=100)
5362 )
5363 schema = tiledb.ArraySchema(
5364 attrs=(tiledb.Attr("attr1"), tiledb.Attr("attr2")), domain=dom
5365 )
5366
5367 with tmpdir() as uri:
5368 tiledb.DenseArray.create(uri, schema)
5369 tdb = tiledb.DenseArray(uri, "w")
5370
5371 rng = np.random.default_rng()
5372 ar1 = rng.standard_normal(tdb.schema.shape)
5373 ar2 = rng.standard_normal(tdb.schema.shape)
5374
5375 tdb[:] = {"attr1": ar1, "attr2": ar2}
5376 tdb = tiledb.DenseArray(uri, "r")
5377
5378 # basic round-trip from dask.array
5379 d = da.from_tiledb(uri, attribute="attr2")
5380 assert_eq(d, ar2)
5381
5382 # smoke-test computation directly on the TileDB view
5383 d = da.from_tiledb(uri, attribute="attr2")
5384 assert_eq(np.mean(ar2), d.mean().compute(scheduler="threads"))
5385
5386
5387def test_blockview():

Callers

nothing calls this directly

Calls 5

tmpdirFunction · 0.90
assert_eqFunction · 0.90
standard_normalMethod · 0.45
meanMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…