File size: 773 Bytes
2c3c408 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | import tempfile
import numpy as np
import tiledb
class MetadataTest:
def setup(self):
self.path = tempfile.mkdtemp()
print(self.path)
self.array = np.random.rand(4)
tiledb.from_numpy(self.path, self.array)
class MetadataWrite(MetadataTest):
def setup(self):
super().setup()
def time_write(self):
with tiledb.open(self.path, "w") as A:
for i in range(1_000_000):
A.meta["x"] = "xyz"
class MetadataRead(MetadataTest):
def setup(self):
super().setup()
with tiledb.open(self.path, "w") as A:
A.meta["x"] = "xyz"
def time_read(self):
with tiledb.open(self.path) as A:
for i in range(1_000_000):
A.meta["x"]
|