Skip to content

Commit 8cb3abf

Browse files
committed
Fix dtype support
1 parent 6b15718 commit 8cb3abf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/zarr/dtype.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
RawBytes,
2323
RawBytesJSON_V2,
2424
RawBytesJSON_V3,
25+
Struct,
26+
StructJSON_V3,
2527
Structured,
2628
StructuredJSON_V2,
2729
StructuredJSON_V3,
@@ -68,6 +70,8 @@
6870
"RawBytes",
6971
"RawBytesJSON_V2",
7072
"RawBytesJSON_V3",
73+
"Struct",
74+
"StructJSON_V3",
7175
"Structured",
7276
"StructuredJSON_V2",
7377
"StructuredJSON_V3",

tests/test_v2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from zarr import config
1515
from zarr.abc.store import Store
1616
from zarr.core.buffer.core import default_buffer_prototype
17-
from zarr.core.dtype import FixedLengthUTF32, Structured, VariableLengthUTF8
17+
from zarr.core.dtype import FixedLengthUTF32, VariableLengthUTF8
18+
from zarr.core.dtype.npy.structured import Struct
1819
from zarr.core.dtype.npy.bytes import NullTerminatedBytes
1920
from zarr.core.dtype.wrapper import ZDType
2021
from zarr.core.group import Group
@@ -283,7 +284,7 @@ def test_structured_dtype_roundtrip(fill_value: float | bytes, tmp_path: Path) -
283284
def test_parse_structured_fill_value_valid(
284285
fill_value: Any, dtype: np.dtype[Any], expected_result: Any
285286
) -> None:
286-
zdtype = Structured.from_native_dtype(dtype)
287+
zdtype = Struct.from_native_dtype(dtype)
287288
result = zdtype.cast_scalar(fill_value)
288289
assert result.dtype == expected_result.dtype
289290
assert result == expected_result

0 commit comments

Comments
 (0)