@@ -222,7 +222,7 @@ def decode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) ->
222
222
return - np .inf
223
223
else :
224
224
return np .array (v , dtype = dtype )[()]
225
- elif dtype .kind in "c" :
225
+ elif dtype .kind == "c" :
226
226
v = (
227
227
cls .decode_fill_value (v [0 ], dtype .type ().real .dtype ),
228
228
cls .decode_fill_value (v [1 ], dtype .type ().imag .dtype ),
@@ -269,23 +269,23 @@ def encode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) ->
269
269
return "-Infinity"
270
270
else :
271
271
return float (v )
272
- elif dtype .kind in "ui" :
272
+ elif dtype .kind in ( "u" , "i" ) :
273
273
return int (v )
274
274
elif dtype .kind == "b" :
275
275
return bool (v )
276
- elif dtype .kind in "c" :
276
+ elif dtype .kind == "c" :
277
277
c = cast (np .complex128 , np .dtype (complex ).type ())
278
278
v = (
279
279
cls .encode_fill_value (v .real , c .real .dtype , object_codec ),
280
280
cls .encode_fill_value (v .imag , c .imag .dtype , object_codec ),
281
281
)
282
282
return v
283
- elif dtype .kind in "SV" :
283
+ elif dtype .kind in ( "S" , "V" ) :
284
284
v = str (base64 .standard_b64encode (v ), "ascii" )
285
285
return v
286
286
elif dtype .kind == "U" :
287
287
return v
288
- elif dtype .kind in "mM" :
288
+ elif dtype .kind in ( "m" , "M" ) :
289
289
return int (v .view ("i8" ))
290
290
else :
291
291
return v
0 commit comments