@@ -1471,12 +1471,18 @@ def __dealloc__(self):
14711471
14721472
14731473def _open_special_store (urlpath , mode , offset , ** kwargs ):
1474- if urlpath .endswith (".b2z" ) or urlpath . endswith ( ". b2d" ):
1474+ if urlpath .endswith (".b2d" ):
14751475 if offset != 0 :
14761476 raise ValueError ("Offset must be 0 for DictStore" )
14771477 from blosc2 .dict_store import DictStore
14781478
14791479 return DictStore (urlpath , mode = mode , ** kwargs )
1480+ elif urlpath .endswith (".b2z" ):
1481+ if offset != 0 :
1482+ raise ValueError ("Offset must be 0 for TreeStore" )
1483+ from blosc2 .tree_store import TreeStore
1484+
1485+ return TreeStore (urlpath , mode = mode , ** kwargs )
14801486 elif urlpath .endswith (".b2e" ):
14811487 if offset != 0 :
14821488 raise ValueError ("Offset must be 0 for EmbedStore" )
@@ -1520,9 +1526,18 @@ def _process_opened_object(res):
15201526
15211527def open (
15221528 urlpath : str | pathlib .Path | blosc2 .URLPath , mode : str = "a" , offset : int = 0 , ** kwargs : dict
1523- ) -> blosc2 .SChunk | blosc2 .NDArray | blosc2 .C2Array | blosc2 .LazyArray | blosc2 .Proxy | Any :
1529+ ) -> (
1530+ blosc2 .SChunk
1531+ | blosc2 .NDArray
1532+ | blosc2 .C2Array
1533+ | blosc2 .LazyArray
1534+ | blosc2 .Proxy
1535+ | blosc2 .DictStore
1536+ | blosc2 .TreeStore
1537+ | blosc2 .EmbedStore
1538+ ):
15241539 """Open a persistent :ref:`SChunk`, :ref:`NDArray`, a remote :ref:`C2Array`,
1525- a :ref:`Proxy`, a :ref:`DictStore` or an :ref:`EmbedStore `.
1540+ a :ref:`Proxy`, a :ref:`DictStore`, :ref:`EmbedStore`, or :ref:`TreeStore `.
15261541
15271542 See the `Notes` section for more info on opening `Proxy` objects.
15281543
@@ -1558,7 +1573,7 @@ def open(
15581573
15591574 Returns
15601575 -------
1561- out: :ref:`SChunk`, :ref:`NDArray`, :ref:`C2Array`, :ref:`DictStore` or :ref:`EmbedStore `
1576+ out: :ref:`SChunk`, :ref:`NDArray`, :ref:`C2Array`, :ref:`DictStore`, :ref:`EmbedStore`, or :ref:`TreeStore `
15621577 The object found in the path.
15631578
15641579 Notes
0 commit comments