@@ -36,6 +36,8 @@ class DictStore:
3636 are stored as .b2nd files.
3737 - blosc2.SChunk: super-chunks. When persisted externally they are stored
3838 as .b2f files.
39+ - blosc2.BatchStore: batched variable-length containers. When persisted
40+ externally they are stored as .b2b files.
3941 - blosc2.C2Array: columnar containers. These are always kept inside the
4042 embedded store (never externalized).
4143 - numpy.ndarray: converted to blosc2.NDArray on assignment.
@@ -91,7 +93,7 @@ class DictStore:
9193 Notes
9294 -----
9395 - External persistence uses the following file extensions:
94- .b2nd for NDArray and .b2f for SChunk.
96+ .b2nd for NDArray, .b2f for SChunk, and .b2b for BatchStore .
9597 """
9698
9799 def __init__ (
@@ -181,8 +183,11 @@ def _init_read_mode(self, dparams: blosc2.DParams | None = None):
181183 dparams = dparams ,
182184 )
183185 for filepath in self .offsets :
184- if filepath .endswith ((".b2nd" , ".b2f" )):
185- key = "/" + filepath [: - 5 if filepath .endswith (".b2nd" ) else - 4 ]
186+ if filepath .endswith ((".b2nd" , ".b2f" , ".b2b" )):
187+ if filepath .endswith (".b2nd" ):
188+ key = "/" + filepath [:- 5 ]
189+ else :
190+ key = "/" + filepath [:- 4 ]
186191 self .map_tree [key ] = filepath
187192 else : # .b2d
188193 if not os .path .isdir (self .localpath ):
@@ -228,14 +233,14 @@ def _update_map_tree(self):
228233 for root , _ , files in os .walk (self .working_dir ):
229234 for file in files :
230235 filepath = os .path .join (root , file )
231- if filepath .endswith ((".b2nd" , ".b2f" )):
236+ if filepath .endswith ((".b2nd" , ".b2f" , ".b2b" )):
232237 # Convert filename to key: remove extension and ensure starts with /
233238 rel_path = os .path .relpath (filepath , self .working_dir )
234239 # Normalize path separators to forward slashes for cross-platform consistency
235240 rel_path = rel_path .replace (os .sep , "/" )
236241 if rel_path .endswith (".b2nd" ):
237242 key = rel_path [:- 5 ]
238- elif rel_path .endswith (".b2f" ):
243+ elif rel_path .endswith (".b2b" ) or rel_path . endswith ( ". b2f" ):
239244 key = rel_path [:- 4 ]
240245 else :
241246 continue
@@ -264,6 +269,8 @@ def _is_external_value(value: blosc2.Array | SChunk | blosc2.VLArray | blosc2.Ba
264269 def _external_ext (value : blosc2 .Array | SChunk | blosc2 .VLArray | blosc2 .BatchStore ) -> str :
265270 if isinstance (value , blosc2 .NDArray ):
266271 return ".b2nd"
272+ if isinstance (value , blosc2 .BatchStore ):
273+ return ".b2b"
267274 return ".b2f"
268275
269276 def __setitem__ (
0 commit comments