[Scipy-tickets] [SciPy] #1302: loadmat creates "unnormalized" byte orders

SciPy Trac scipy-tickets@scipy....
Wed Oct 13 14:26:40 CDT 2010

#1302: loadmat creates "unnormalized" byte orders
 Reporter:  pv                      |       Owner:  somebody
     Type:  defect                  |      Status:  new     
 Priority:  normal                  |   Milestone:  0.9.0   
Component:  scipy.io                |     Version:  0.8.0   
 Keywords:  loadmat byte order mio  |  
 See #1300 -- in the example file there we have
 >>> import numpy as np
 >>> import scipy.io
 >>> x = scipy.io.loadmat('SINE_C1.MAT')['GEDAP_DATA_Y']
 >>> x.dtype.byteorder
 >>> np.dtype('<f8').byteorder
 >>> hash(np.dtype('<f8')), hash(x.dtype)
 (-601232417, -391356868)

 The Matlab readers seem to create dtypes with "unnormalized" byte order
 character. This causes problems, since dtypes with '=' and the native '>'
 or '<' do not at the moment hash the same.

 There seems to be no way in "native" numpy to create "unnormalized" dtype
 byte orders, so perhaps the Matlab readers shouldn't do that either.

Ticket URL: <http://projects.scipy.org/scipy/ticket/1302>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list