Thanks Tom,<br><br>before we ship it, I'd love to have some feedback on the new ARGOUT_VIEWM type.<br><br>I used to create my managed arrays using <br><br>    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);<br>
<br>but since this function is deprecated, and because of Bill's background work to bring numpy.i up to date, I now use capsules for this:<br><br>    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);<br>
<br>... I'll admit it took longer than expected to get this right.<br><br>Would you mind testing my latest numpy.i changes hosted on github?<br><a href="https://github.com/zindy/numpy/tree/numpy-swig/doc/swig">https://github.com/zindy/numpy/tree/numpy-swig/doc/swig</a><br>
<br>It's great that you are testing on a mac, I don't have one to test on yet.<br><br>> It worked fine, although I use only a fraction of the capabilities that it includes. <br><br>Same here, but overall, it should be quit easy to choose the data type you need. Narrow down it down to a type between IN_ARRAY / INPLACE_ / ARGOUT_ / ARGOUT_VIEW/VIEWM<br>
<a href="http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples">http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples</a><br><a href="http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation">http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation</a> (I'll update these when I have a sec)<br>
<br>... and choose the number of dimensions you need (1/2/3/4). I can't comment on the Fortran arrays data types though as I don't use them.<br><br>Also I've introduced a few of my more esoteric data types in this week, but I have no idea how popular they will be. If you ever need to speed-up:<br>
<br><div>a = numpy.ones((1024,1024),numpy.uint8)</div><div>la = [a]*100</div><div>b = numpy.mean(numpy.array(la,float),axis=0).astype(numpy.uint8)<br><br>I have just the right type for that :)<br></div>DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3<br>
<br>Kind regards,<br>Egor<br><br><div class="gmail_quote">On 9 June 2013 03:33, Tom Krauss <span dir="ltr"><<a href="mailto:thomas.p.krauss@gmail.com" target="_blank">thomas.p.krauss@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br><div>I just downloaded Bill's <a href="https://github.com/wfspotz/numpy/blob/4dcb06796b290ae29d4e73ad995d219087f2e949/doc/swig/numpy.i" target="_blank">numpy.i </a>at commit 4dcb0679, and tried it out a bit on some of my personal projects.  It worked fine, although I use only a fraction of the capabilities that it includes. </div>


<div><br></div><div> And, it made the warning go away!</div><div><br></div><div>I used to get this warning</div><div><br></div><div><div>g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7 -I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include</div>


<div>In file included from /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,</div><div>                 from /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,</div>


<div>                 from /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,</div><div>                 from simple_wrap.cpp:3062:</div>


<div>/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"</div>


<div><br></div><div>but not with this version.</div><div><br></div><div>You can see which version of numpy I am using there, and that I am on Mac OS X 10.8. (10.8.4 specifically)  Python 2.7.2</div><div>

<br></div><div>I'd say SHIP IT!</div><div><br></div><div>Nice work, thanks for all your work on numpy and numpy.i.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>- Tom Krauss</div><div><br></div>
</font></span></div></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers <span dir="ltr"><<a href="mailto:ralf.gommers@gmail.com" target="_blank">ralf.gommers@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>If you're using or are very familiar with SWIG and the numpy.i interface to it, please help to test and/or review <a href="https://github.com/numpy/numpy/pull/3148" target="_blank">https://github.com/numpy/numpy/pull/3148</a>. It's a fairly major update to numpy.i by Bill Spotz, containing the following:<br>



  - support for 4D arrays and memory managed output arguments<br></div>  - rework for the deprecated API's in numpy 1.6 and 1.7<br></div>  - a bug fix in a 3D typemap<br></div>  - documentation improvements<br><br></div>



It would be good to have this merged before branching 1.8.x. Not many of the regular reviewers of numpy PRs are familiar with numpy.i, therefore help would be much appreciated.<br><br></div>Thanks,<br>Ralf<br><br></div>
<br></div></div><div class="im">_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br>