()
| 5356 | |
| 5357 | |
| 5358 | def 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 | |
| 5387 | def test_blockview(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…