[NumPy-Tickets] [NumPy] #2073: stride_tricks with float16

NumPy Trac numpy-tickets@scipy....
Mon Mar 12 13:32:11 CDT 2012


#2073: stride_tricks with float16
--------------------+-------------------------------------------------------
 Reporter:  npinto  |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  1.6.1      
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by npinto):

 Reproducing the bug with HEAD:

 {{{
 In [1]: import numpy as np

 In [2]: np.__version__
 Out[2]: '1.7.0.dev-737f690'

 In [3]: !cat bug2.py
 import numpy as np

 f2 = np.empty((1), dtype='float16')

 class Foo: pass
 a = Foo()
 a.__array_interface__ = f2.__array_interface__

 np.array(a, 'float16')
 np.array(f2, 'float16')

 In [4]: run bug2.py
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 /Users/nich2o/venv/numpy-dev/lib/python2.7/site-
 packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
     173             else:
     174                 filename = fname
 --> 175             __builtin__.execfile(filename, *where)

 /Users/nich2o/bug2.py in <module>()
       7 a.__array_interface__ = f2.__array_interface__
       8
 ----> 9 np.array(a, 'float16')
      10 np.array(f2, 'float16')

 ValueError: unsupported typestring
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2073#comment:8>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list