88from zarr .core .dtype .npy .float import Float16 , Float64
99from zarr .core .dtype .npy .int import Int32 , Int64
1010from zarr .core .dtype .npy .sized import (
11- FixedLengthAscii ,
11+ FixedLengthASCII ,
1212 FixedLengthBytes ,
13- FixedLengthUnicode ,
13+ FixedLengthUTF32 ,
1414 Structured ,
1515)
1616
1717
1818class TestFixedLengthAscii (_TestZDType ):
19- test_cls = FixedLengthAscii
19+ test_cls = FixedLengthASCII
2020 valid_dtype = (np .dtype ("|S10" ), np .dtype ("|S4" ))
2121 invalid_dtype = (
2222 np .dtype (np .int8 ),
@@ -36,24 +36,24 @@ class TestFixedLengthAscii(_TestZDType):
3636 )
3737
3838 scalar_v2_params = (
39- (FixedLengthAscii (length = 0 ), "" ),
40- (FixedLengthAscii (length = 2 ), "YWI=" ),
41- (FixedLengthAscii (length = 4 ), "YWJjZA==" ),
39+ (FixedLengthASCII (length = 0 ), "" ),
40+ (FixedLengthASCII (length = 2 ), "YWI=" ),
41+ (FixedLengthASCII (length = 4 ), "YWJjZA==" ),
4242 )
4343 scalar_v3_params = (
44- (FixedLengthAscii (length = 0 ), "" ),
45- (FixedLengthAscii (length = 2 ), "YWI=" ),
46- (FixedLengthAscii (length = 4 ), "YWJjZA==" ),
44+ (FixedLengthASCII (length = 0 ), "" ),
45+ (FixedLengthASCII (length = 2 ), "YWI=" ),
46+ (FixedLengthASCII (length = 4 ), "YWJjZA==" ),
4747 )
4848 cast_value_params = (
49- (FixedLengthAscii (length = 0 ), "" , np .bytes_ ("" )),
50- (FixedLengthAscii (length = 2 ), "ab" , np .bytes_ ("ab" )),
51- (FixedLengthAscii (length = 4 ), "abcd" , np .bytes_ ("abcd" )),
49+ (FixedLengthASCII (length = 0 ), "" , np .bytes_ ("" )),
50+ (FixedLengthASCII (length = 2 ), "ab" , np .bytes_ ("ab" )),
51+ (FixedLengthASCII (length = 4 ), "abcd" , np .bytes_ ("abcd" )),
5252 )
5353 item_size_params = (
54- FixedLengthAscii (length = 0 ),
55- FixedLengthAscii (length = 4 ),
56- FixedLengthAscii (length = 10 ),
54+ FixedLengthASCII (length = 0 ),
55+ FixedLengthASCII (length = 4 ),
56+ FixedLengthASCII (length = 10 ),
5757 )
5858
5959
@@ -103,42 +103,42 @@ class TestFixedLengthBytes(_TestZDType):
103103 )
104104
105105
106- class TestFixedLengthUnicode (_TestZDType ):
107- test_cls = FixedLengthUnicode
106+ class TestFixedLengthUTF32 (_TestZDType ):
107+ test_cls = FixedLengthUTF32
108108 valid_dtype = (np .dtype (">U10" ), np .dtype ("<U10" ))
109109 invalid_dtype = (
110110 np .dtype (np .int8 ),
111111 np .dtype (np .float64 ),
112112 np .dtype ("|S10" ),
113113 )
114114 valid_json_v2 = (">U10" , "<U10" )
115- valid_json_v3 = ({"name" : "numpy.fixed_length_ucs4 " , "configuration" : {"length_bytes" : 320 }},)
115+ valid_json_v3 = ({"name" : "numpy.fixed_length_utf32 " , "configuration" : {"length_bytes" : 320 }},)
116116 invalid_json_v2 = (
117117 "|U" ,
118118 "|S10" ,
119119 "|f8" ,
120120 )
121121 invalid_json_v3 = (
122- {"name" : "numpy.fixed_length_ucs4 " , "configuration" : {"length_bits" : 0 }},
123- {"name" : "numpy.fixed_length_ucs4 " , "configuration" : {"length_bits" : "invalid" }},
122+ {"name" : "numpy.fixed_length_utf32 " , "configuration" : {"length_bits" : 0 }},
123+ {"name" : "numpy.fixed_length_utf32 " , "configuration" : {"length_bits" : "invalid" }},
124124 )
125125
126- scalar_v2_params = ((FixedLengthUnicode (length = 0 ), "" ), (FixedLengthUnicode (length = 2 ), "hi" ))
126+ scalar_v2_params = ((FixedLengthUTF32 (length = 0 ), "" ), (FixedLengthUTF32 (length = 2 ), "hi" ))
127127 scalar_v3_params = (
128- (FixedLengthUnicode (length = 0 ), "" ),
129- (FixedLengthUnicode (length = 2 ), "hi" ),
130- (FixedLengthUnicode (length = 4 ), "hihi" ),
128+ (FixedLengthUTF32 (length = 0 ), "" ),
129+ (FixedLengthUTF32 (length = 2 ), "hi" ),
130+ (FixedLengthUTF32 (length = 4 ), "hihi" ),
131131 )
132132
133133 cast_value_params = (
134- (FixedLengthUnicode (length = 0 ), "" , np .str_ ("" )),
135- (FixedLengthUnicode (length = 2 ), "hi" , np .str_ ("hi" )),
136- (FixedLengthUnicode (length = 4 ), "hihi" , np .str_ ("hihi" )),
134+ (FixedLengthUTF32 (length = 0 ), "" , np .str_ ("" )),
135+ (FixedLengthUTF32 (length = 2 ), "hi" , np .str_ ("hi" )),
136+ (FixedLengthUTF32 (length = 4 ), "hihi" , np .str_ ("hihi" )),
137137 )
138138 item_size_params = (
139- FixedLengthUnicode (length = 0 ),
140- FixedLengthUnicode (length = 4 ),
141- FixedLengthUnicode (length = 10 ),
139+ FixedLengthUTF32 (length = 0 ),
140+ FixedLengthUTF32 (length = 4 ),
141+ FixedLengthUTF32 (length = 10 ),
142142 )
143143
144144
@@ -180,7 +180,7 @@ class TestStructured(_TestZDType):
180180 ),
181181 (
182182 "field2" ,
183- {"name" : "numpy.fixed_length_ucs4 " , "configuration" : {"length_bytes" : 32 }},
183+ {"name" : "numpy.fixed_length_utf32 " , "configuration" : {"length_bytes" : 32 }},
184184 ),
185185 ]
186186 },
0 commit comments