|
14 | 14 |
|
15 | 15 | # Create a hierarchical store backed by a zip file |
16 | 16 | with blosc2.TreeStore("example_tree.b2z", mode="w") as tstore: |
17 | | - # Create a small hierarchy. Data must be stored at leaves. |
18 | | - tstore["/child0/data"] = np.array([1, 2, 3]) # embedded (numpy) |
19 | | - tstore["/child0/child1/data"] = blosc2.ones(3) # embedded (NDArray) |
20 | | - tstore["/child0/child2"] = blosc2.arange(3) # embedded (NDArray) |
| 17 | + # Create a small hierarchy |
| 18 | + tstore["/child0/data"] = np.array([1, 2, 3]) |
| 19 | + tstore["/child0/child1/data"] = blosc2.ones(3) |
| 20 | + tstore["/child0/child2"] = blosc2.arange(3) |
21 | 21 |
|
22 | | - # External array stored as separate .b2nd file |
| 22 | + # External arrays can also be included |
23 | 23 | ext = blosc2.linspace(0, 1, 5, urlpath="external_leaf.b2nd", mode="w") |
24 | 24 | ext.vlmeta["desc"] = "external /dir1/node3 metadata" # NDArray-level metadata |
25 | 25 | tstore["/dir1/node3"] = ext |
26 | 26 |
|
27 | | - # # Remote array (read-only), referenced via URLPath |
| 27 | + # Remote array (read-only), referenced via URLPath |
28 | 28 | urlpath = blosc2.URLPath("@public/examples/ds-1d.b2nd", "https://cat2.cloud/demo") |
29 | 29 | arr_remote = blosc2.open(urlpath, mode="r") |
30 | 30 | tstore["/dir2/remote"] = arr_remote |
|
0 commit comments