Here's the code which is the first cell of a sage notebook (sage 4.0)<br><br>%cython<br>import numpy as np<br>cimport numpy as np<br>DTYPE = <a href="http://np.int">np.int</a><br>ctypedef np.int_t DTYPE_t<br><br>Here's the error:<br>
<br><pre class="shrunk">Traceback (most recent call last): DTYPE = <a href="http://np.int">np.int</a><br> File "/mnt/hdd/sage/sage-4.0/local/lib/python2.5/site-packages/sage/server/support.py", line 408, in cython_import_all<br>
create_local_c_file=create_local_c_file)<br> File "/mnt/hdd/sage/sage-4.0/local/lib/python2.5/site-packages/sage/server/support.py", line 385, in cython_import<br> create_local_c_file=create_local_c_file)<br>
File "/mnt/hdd/sage/sage-4.0/local/lib/python2.5/site-packages/sage/misc/cython.py", line 367, in cython<br> raise RuntimeError, "Error converting %s to C:\n%s\n%s"%(filename, log, err)<br>RuntimeError: Error converting /home/tarbox/.sage/sage_notebook/worksheets/admin/89/code/sage23.spyx to C:<br>
<br><br>Error converting Pyrex file to C:<br>------------------------------------------------------------<br>...<br><br>include "cdefs.pxi"<br>import numpy as np<br>cimport numpy as np<br>DTYPE = <a href="http://np.int">np.int</a><br>
ctypedef np.int_t DTYPE_t ^<br>------------------------------------------------------------<br><br>/home/tarbox/.sage/temp/hq2/12471/spyx/_home_tarbox__sage_sage_notebook_worksheets_admin_89_code_sage23_spyx/_home_tarbox__sage_sage_notebook_worksheets_admin_89_code_sage23_spyx_0.pyx:9:9: 'int_t' is not a type identifier</pre>
<br clear="all">I tried with and without the "import numpy" directive thinking it may be redundant...<br><br>This example comes from the "cython for numpy users" tutorial on the wiki where it mentions that all numpy types have a corresponding _t type<br>
<br>There is indeed a <a href="http://numpy.int">numpy.int</a> type... so I was wondering if the new work with python buffers changed how things work.<br><br>-glenn<br><br>-- <br>Glenn H. Tarbox, PhD || 206-274-6919<br><a href="http://www.tarbox.org">http://www.tarbox.org</a><br>