3232 14 : {"dtype" : np .dtype ("int64" ), "scalar_type" : "INT64" },
3333 15 : {"dtype" : np .dtype ("uint64" ), "scalar_type" : "UINT64" },
3434 16 : {"dtype" : None , "scalar_type" : "FUNCTION" },
35- 65536 : {"dtype" : np .dtype ("datetime64[Y]" ), "scalar_type" : "DATETIME64[Y]" },
36- 65537 : {"dtype" : np .dtype ("datetime64[M]" ), "scalar_type" : "DATETIME64[M]" },
37- 65538 : {"dtype" : np .dtype ("datetime64[W]" ), "scalar_type" : "DATETIME64[W]" },
38- 65539 : {"dtype" : np .dtype ("datetime64[D]" ), "scalar_type" : "DATETIME64[D]" },
39- 65540 : {"dtype" : np .dtype ("datetime64[h]" ), "scalar_type" : "DATETIME64[h]" },
40- 65541 : {"dtype" : np .dtype ("datetime64[m]" ), "scalar_type" : "DATETIME64[m]" },
41- 65542 : {"dtype" : np .dtype ("datetime64[s]" ), "scalar_type" : "DATETIME64[s]" },
42- 65543 : {"dtype" : np .dtype ("datetime64[ms]" ), "scalar_type" : "DATETIME64[ms]" },
43- 65544 : {"dtype" : np .dtype ("datetime64[us]" ), "scalar_type" : "DATETIME64[us]" },
44- 65545 : {"dtype" : np .dtype ("datetime64[ns]" ), "scalar_type" : "DATETIME64[ns]" },
45- 65546 : {"dtype" : np .dtype ("datetime64[ps]" ), "scalar_type" : "DATETIME64[ps]" },
46- 65547 : {"dtype" : np .dtype ("datetime64[fs]" ), "scalar_type" : "DATETIME64[fs]" },
47- 65548 : {"dtype" : np .dtype ("datetime64[as]" ), "scalar_type" : "DATETIME64[as]" },
35+ 65_536 : {"dtype" : np .dtype ("datetime64[Y]" ), "scalar_type" : "DATETIME64[Y]" },
36+ 65_537 : {"dtype" : np .dtype ("datetime64[M]" ), "scalar_type" : "DATETIME64[M]" },
37+ 65_538 : {"dtype" : np .dtype ("datetime64[W]" ), "scalar_type" : "DATETIME64[W]" },
38+ 65_539 : {"dtype" : np .dtype ("datetime64[D]" ), "scalar_type" : "DATETIME64[D]" },
39+ 65_540 : {"dtype" : np .dtype ("datetime64[h]" ), "scalar_type" : "DATETIME64[h]" },
40+ 65_541 : {"dtype" : np .dtype ("datetime64[m]" ), "scalar_type" : "DATETIME64[m]" },
41+ 65_542 : {"dtype" : np .dtype ("datetime64[s]" ), "scalar_type" : "DATETIME64[s]" },
42+ 65_543 : {"dtype" : np .dtype ("datetime64[ms]" ), "scalar_type" : "DATETIME64[ms]" },
43+ 65_544 : {"dtype" : np .dtype ("datetime64[us]" ), "scalar_type" : "DATETIME64[us]" },
44+ 65_545 : {"dtype" : np .dtype ("datetime64[ns]" ), "scalar_type" : "DATETIME64[ns]" },
45+ 65_546 : {"dtype" : np .dtype ("datetime64[ps]" ), "scalar_type" : "DATETIME64[ps]" },
46+ 65_547 : {"dtype" : np .dtype ("datetime64[fs]" ), "scalar_type" : "DATETIME64[fs]" },
47+ 65_548 : {"dtype" : np .dtype ("datetime64[as]" ), "scalar_type" : "DATETIME64[as]" },
4848}
4949serialize_lookup = {
5050 v ["dtype" ]: {"type_id" : k , "scalar_type" : v ["scalar_type" ]}
@@ -269,14 +269,13 @@ def pack_array(self, array):
269269 try :
270270 type_id = serialize_lookup [array .dtype ]["type_id" ]
271271 except KeyError :
272+ # U is for unicode string
272273 if array .dtype .char == "U" :
273274 type_id = serialize_lookup [np .dtype ("O" )]["type_id" ]
274- pass
275275 else :
276- raise DataJointError ("Type %s is ambiguous or unknown" % array . dtype )
276+ raise DataJointError (f "Type { array . dtype } is ambiguous or unknown" )
277277
278278 blob += np .array ([type_id , is_complex ], dtype = np .uint32 ).tobytes ()
279- # array of dtype('O'), U is for unicode string
280279 if (
281280 array .dtype .char == "U"
282281 or serialize_lookup [array .dtype ]["scalar_type" ] == "VOID"
@@ -286,7 +285,6 @@ def pack_array(self, array):
286285 for it in (self .pack_blob (e ) for e in array .flatten (order = "F" ))
287286 )
288287 self .set_dj0 () # not supported by original mym
289- # array of dtype('c')
290288 elif serialize_lookup [array .dtype ]["scalar_type" ] == "CHAR" :
291289 blob += (
292290 array .view (np .uint8 ).astype (np .uint16 ).tobytes ()
0 commit comments