Skip to content

Commit 2f21cf7

Browse files
committed
[DRAFT] V3 spec implmentation.
This is mostly opened to foster discussion and need code from https://github.com/Carreau/zarr-spec-v3-impl. IN the above mentioned repository I'm working on looking at what an implementation of the spec v3 could look to inform us on the possible transition and compatiblity shims. So far I have a rough implementation of an in memory v3 store as well as multiple utilities. 1) A base class that automatically provide sync version of all async method of a class. I'm playing with the idea of having most method async as this may be useful in some context. For example when creating a array at /a/b/c/d/e/f/g/h/i/j/k you want to check that None of the parents are arrays, which can be done with N async requests. 2) An adapted class that wraps a v3 store and provide a v2 API. My though is that most code is currently v2 compatible and it would be useful for legacy codebase and early testing of store. 3) a class that wrap 2 stores, a reference and a tested one, replicate operation on both stores, and abort if it sees any difference in behavior. This could help to catch changes in behavior. The tests in this PR start to test the v3 memorystore and compare it to the v2 memorystore.
1 parent a61828f commit 2f21cf7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
encode_array_metadata,
3434
decode_array_metadata_v3,
3535
)
36-
from iarr.storage import array_meta_key, attrs_key, getsize, listdir
36+
from zarr.storage import array_meta_key, attrs_key, getsize, listdir
3737
from zarr.util import (InfoReporter, check_array_shape, human_readable_size,
3838
is_total_slice, nolock, normalize_chunks,
3939
normalize_resize_args, normalize_shape,

zarr/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def decode_dtype_v3(d):
166166
return np.dtype(d)
167167

168168

169-
def decode_group_metadata(s: Union[MappingType, str]) -> MappingType[str, Any]:
169+
def decode_group_metadata_v3(s: Union[MappingType, str]) -> MappingType[str, Any]:
170170
return json.loads(s)
171171

172172

0 commit comments

Comments
 (0)