Hello Jay, <div><br></div><div>Cool idea!  I like to see work on structured arrays.  Just a couple of questions:</div><div><ul><li>Since there are already have ufuncs for primitive dtypes (int, float, etc), and you are just acting columnwise here, can't you write a single function which interprets the dtypes, gathers the approriate scalar ufuncs, and applies those down each field?  Yes registering individual functions using your mechanism will be faster, but it will also be more work.</li>

<li>I didn't try this out myself, but will the normal numpy broadcasting rules apply here?</li></ul><div>Be Well</div></div><div>Anthony</div><div><br><div class="gmail_quote">On Mon, Oct 1, 2012 at 10:36 AM, Jay Bourque <span dir="ltr"><<a href="mailto:jay.bourque@continuum.io" target="_blank">jay.bourque@continuum.io</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px"><div>

All,</div><div><br></div><div>I've submitted the following pull request for NumPy:</div>
<div><br></div><div><a href="https://github.com/numpy/numpy/pull/462" target="_blank">https://github.com/numpy/numpy/pull/462</a></div><div><br></div>This change allows ufuncs to be registered for structured arrays by using a new API method </span><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px">PyUFunc_RegisterLoopForStructType. For example, </span><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px">a ufunc could be registered to take two arrays of type 'u8,u8,u8' and return an array of type 'u8,u8,u8'. I have a trivial example of this included in my pull request, along with further details of my changes. I suspect there might be a better way to do this, so any suggestions for improvements would be welcome.</span><div>





<span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px">Thanks,</span></div>





<div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px">-Jay</span></div><div><span style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;line-height:20px"><a href="http://continuum.io" target="_blank">continuum.io</a></span></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></div>