Save array to the TileDB storage format Save 'array' using the TileDB storage manager, to any TileDB-supported URI, including local disk, S3, or HDFS. See https://docs.tiledb.io for more information about TileDB. Parameters ---------- darray: dask.array A dask arr
(
darray,
uri,
compute=True,
return_stored=False,
storage_options=None,
key=None,
**kwargs,
)
| 72 | |
| 73 | |
| 74 | def to_tiledb( |
| 75 | darray, |
| 76 | uri, |
| 77 | compute=True, |
| 78 | return_stored=False, |
| 79 | storage_options=None, |
| 80 | key=None, |
| 81 | **kwargs, |
| 82 | ): |
| 83 | """Save array to the TileDB storage format |
| 84 | |
| 85 | Save 'array' using the TileDB storage manager, to any TileDB-supported URI, |
| 86 | including local disk, S3, or HDFS. |
| 87 | |
| 88 | See https://docs.tiledb.io for more information about TileDB. |
| 89 | |
| 90 | Parameters |
| 91 | ---------- |
| 92 | |
| 93 | darray: dask.array |
| 94 | A dask array to write. |
| 95 | uri: |
| 96 | Any supported TileDB storage location. |
| 97 | storage_options: dict |
| 98 | Dict containing any configuration options for the TileDB backend. |
| 99 | see https://docs.tiledb.io/en/stable/tutorials/config.html |
| 100 | compute, return_stored: see ``store()`` |
| 101 | key: str or None |
| 102 | Encryption key |
| 103 | |
| 104 | Returns |
| 105 | ------- |
| 106 | |
| 107 | None |
| 108 | Unless ``return_stored`` is set to ``True`` (``False`` by default) |
| 109 | |
| 110 | Notes |
| 111 | ----- |
| 112 | |
| 113 | TileDB only supports regularly-chunked arrays. |
| 114 | TileDB `tile extents`_ correspond to form 2 of the dask |
| 115 | `chunk specification`_, and the conversion is |
| 116 | done automatically for supported arrays. |
| 117 | |
| 118 | Examples |
| 119 | -------- |
| 120 | |
| 121 | >>> import dask.array as da, tempfile |
| 122 | >>> uri = tempfile.NamedTemporaryFile().name |
| 123 | >>> data = da.random.random(5,5) |
| 124 | >>> da.to_tiledb(data, uri) |
| 125 | >>> import tiledb |
| 126 | >>> tdb_ar = tiledb.open(uri) |
| 127 | >>> all(tdb_ar == data) |
| 128 | True |
| 129 | |
| 130 | .. _chunk specification: https://docs.tiledb.io/en/stable/tutorials/tiling-dense.html |
| 131 | .. _tile extents: http://docs.dask.org/en/latest/array-chunks.html |