Skip to content

Commit 5f1a0b5

Browse files
docs: updated docs to reflect new blosc2.open syntax
1 parent 66f85cc commit 5f1a0b5

6 files changed

Lines changed: 13 additions & 5 deletions

File tree

doc/reference/dict_store.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Quick example
2929
arr_ext = blosc2.arange(3, urlpath="n3.b2nd", mode="w")
3030
dstore["/dir1/node3"] = arr_ext # external file referenced
3131
32-
# Reopen and read
33-
with blosc2.DictStore("my_dstore.b2z", mode="r") as dstore:
32+
# Reopen and read using blosc2.open
33+
with blosc2.open("my_dstore.b2z", mode="r") as dstore:
3434
print(sorted(dstore.keys())) # ['/dir1/node3', '/node1', '/node2']
3535
print(dstore["/node1"][:]) # [1 2 3]
3636

doc/reference/embed_store.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Quickstart
4141
print(list(estore.keys()))
4242
# ['/node1', '/node2', '/node3', '/node4']
4343
44+
# Reopen using blosc2.open
45+
estore = blosc2.open("example_estore.b2e", mode="r")
46+
print(list(estore.keys()))
47+
4448
.. note::
4549
- Embedded arrays (NumPy, NDArray, and SChunk) increase the size of the ``.b2e`` container.
4650
- Remote ``C2Array`` nodes only store lightweight references; reading them requires access to the remote source. NDArrays coming from external ``.b2nd`` files are embedded into the store.

doc/reference/tree_store.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Quick example
4747
print(sorted(subtree.keys())) # ['/child1/leaf2', '/child2', '/leaf1']
4848
print(subtree["/child1/leaf2"][:]) # [4 5 6]
4949
50+
# Reopen using blosc2.open
51+
with blosc2.open("my_tree.b2z", mode="r") as tstore:
52+
print(sorted(tstore.keys()))
53+
5054
.. currentmodule:: blosc2
5155

5256
.. autoclass:: TreeStore

examples/dict-store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
print("After deletion, keys:", list(dstore.keys()))
3232

3333
# Reading back the dstore
34-
with blosc2.DictStore("example_dstore.b2z", mode="a") as dstore2:
34+
with blosc2.open("example_dstore.b2z", mode="a") as dstore2:
3535
# Add another node to the dstore
3636
dstore2["/dir2/node5"] = np.array([4, 5, 6])
3737
print("Node5 data:", dstore2["/dir2/node5"][:])

examples/embed-store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Reading back the tree
3737
if persistent:
38-
estore_read = blosc2.EmbedStore(urlpath="example_estore.b2e", mode="a")
38+
estore_read = blosc2.open("example_estore.b2e", mode="a")
3939
else:
4040
estore_read = blosc2.from_cframe(estore.to_cframe())
4141

examples/tree-store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
print("After deleting '/child0/child1', keys:", sorted(tstore.keys()))
6161

6262
# Reopen and add another leaf under an existing subtree
63-
with blosc2.TreeStore("example_tree.b2z", mode="a") as tstore2:
63+
with blosc2.open("example_tree.b2z", mode="a") as tstore2:
6464
tstore2["/child0/new_leaf"] = np.array([9, 9, 9])
6565
print("Reopened keys:", sorted(tstore2.keys()))
6666
# Read via subtree view

0 commit comments

Comments
 (0)