File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -189,12 +189,17 @@ def type_from_np(cls, nptype):
189189 # Handle special cases first
190190 if nptype == np .int8 :
191191 return Int16
192- if nptype == np .uint8 :
192+ elif nptype == np .uint8 :
193193 return Byte
194- # then handle the rest
195- for subclass in cls .subclasses ():
196- if subclass .dtype == nptype :
197- return subclass
194+ elif nptype == np .int64 :
195+ return Int32
196+ elif nptype == np .uint64 :
197+ return UInt32
198+ else :
199+ # then handle the rest
200+ for subclass in cls .subclasses ():
201+ if subclass .dtype == nptype :
202+ return subclass
198203
199204 def das (self , constraint = '' ):
200205 if meets_constraint (constraint , self .data_path ):
@@ -475,9 +480,9 @@ def dods_encode(data, dtype):
475480 length = np .prod (data .shape )
476481 packed_length = b''
477482 if not is_scalar :
478- packed_length = length .astype ('<i4' ).byteswap ().tostring () * 2
483+ packed_length = length .astype ('<i4' ).byteswap ().tobytes () * 2
479484
480- packed_data = data .astype (dtype .str ).byteswap ().tostring ()
485+ packed_data = data .astype (dtype .str ).byteswap ().tobytes ()
481486
482487 return packed_length + packed_data
483488
You can’t perform that action at this time.
0 commit comments