[Numpy-discussion] Proposal for new ufunc functionality

Anne Archibald peridot.faceted@gmail....
Sun Apr 11 14:56:24 CDT 2010

2010/4/10 Stéfan van der Walt <stefan@sun.ac.za>:
> On 10 April 2010 19:45, Pauli Virtanen <pav@iki.fi> wrote:
>> Another addition to ufuncs that should be though about is specifying the
>> Python-side interface to generalized ufuncs.
> This is an interesting idea; what do you have in mind?

I can see two different kinds of answer to this question: one is a
tool like vectorize/frompyfunc that allows construction of generalized
ufuncs from python functions, and the other is thinking out what
methods and support functions generalized ufuncs need.

The former would be very handy for prototyping gufunc-based libraries
before delving into the templated C required to make them actually

The latter is more essential in the long run: it'd be nice to have a
reduce-like function, but obviously only when the arity and dimensions
work out right (which I think means (shape1,shape2)->(shape2) ). This
could be applied along an axis or over a whole array. reduceat and the
other, more sophisticated, schemes might also be worth supporting. At
a more elementary level, gufunc objects should have good introspection
- docstrings, shape specification accessible from python, named formal
arguments, et cetera. (So should ufuncs, for that matter.)


> Regards
> Stéfan
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list