File tree Expand file tree Collapse file tree 5 files changed +6
-8
lines changed Expand file tree Collapse file tree 5 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ def parse_bool(data: Any) -> bool:
170170def parse_dtype (dtype : Any , zarr_format : ZarrFormat ) -> np .dtype [Any ]:
171171 if "datatype" in type (dtype ).__name__ .lower ():
172172 # Workaround until we have the class in place
173- return dtype .to_numpy () # TODO: call conversion method
173+ return np . dtype ( dtype .to_numpy () ) # TODO: call conversion method
174174 if dtype is str or dtype == "str" :
175175 if zarr_format == 2 :
176176 # special case as object
Original file line number Diff line number Diff line change @@ -663,7 +663,6 @@ def to_numpy_shortname(self) -> str:
663663 }
664664 return data_type_to_numpy [self ]
665665
666-
667666 def to_numpy (self ) -> np .dtypes .StringDType | np .dtypes .ObjectDType | np .dtype [Any ]:
668667 # note: it is not possible to round trip DataType <-> np.dtype
669668 # due to the fact that DataType.string and DataType.bytes both
Original file line number Diff line number Diff line change 1919 )
2020 from zarr .core .buffer import Buffer , NDBuffer
2121 from zarr .core .common import JSON
22+ from zarr .core .metadata .v3 import DataType
2223
2324__all__ = [
2425 "Registry" ,
Original file line number Diff line number Diff line change @@ -1447,8 +1447,7 @@ async def test_sharding_coordinate_selection() -> None:
14471447
14481448
14491449@pytest .mark .xfail (reason = "zarr.common.core maps any string to the string type" )
1450- async def test_array_v3_ext_uri_by_string (
1451- ) -> None :
1450+ async def test_array_v3_ext_uri_by_string () -> None :
14521451 """
14531452 Test the user impact of the extension mechanism
14541453 """
@@ -1460,11 +1459,10 @@ async def test_array_v3_ext_uri_by_string(
14601459 shape = (12 ,),
14611460 chunks = (3 ,),
14621461 )
1463- assert arr .data_type == None # TODO: import the example dtype
1462+ assert arr .dtype == np . dtype ( bool )
14641463
14651464
1466- async def test_array_v3_ext_uri_by_class (
1467- ) -> None :
1465+ async def test_array_v3_ext_uri_by_class () -> None :
14681466 """
14691467 Test the user impact of the extension mechanism
14701468 """
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ def test_dtypes(dtype_str: str) -> None:
412412 # return type for vlen types may vary depending on numpy version
413413 assert dt .byte_count is None
414414
415+
415416async def test_ext_uri () -> None :
416417 metadata_dict = {
417418 "zarr_format" : 3 ,
@@ -424,5 +425,4 @@ async def test_ext_uri() -> None:
424425 "fill_value" : 0 ,
425426 }
426427 m = ArrayV3Metadata .from_dict (metadata_dict )
427- d = json .loads (m .to_buffer_dict (default_buffer_prototype ())["zarr.json" ].to_bytes ())
428428 assert m .data_type is DataType .example
You can’t perform that action at this time.
0 commit comments