[Numpy-discussion] numpy1.2 : make sorts unary ufuncs

Travis E. Oliphant oliphant at enthought.com
Sat Apr 19 02:20:38 EDT 2008


Charles R Harris wrote:
> The signature for a ufunc is something like
>
> @TYPE at _@kind@(char **args, intp *dimensions, intp *steps, void *func)
>
> Which contains all the info necessary to do a sort. Means and other 
> such functions could also be implemented that way.
I dont' think the ufunc is the right place for this.    Perhaps sorting 
can be viewed however as a "general function" which I'd like to add.  
Maybe, in that case the ufunc could be a special case of the "general 
function" concept.   But, that is the direction I would expect the 
discussion to go.

The ufunc object is a very particular kind of thing.   The 1-d inner 
loop signature is a key part of it, but there is more to it than that.   
I don't see  how the sorting function can be pushed into this concept.

But, there is a case to be made for perhaps figuring out how to merge 
the data-type functions and the ufuncs into one idea that allows for 
better code re-use.

-Travis





More information about the NumPy-Discussion mailing list