[Numpy-discussion] ufuncs on user-defined types in numarray

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Fri Dec 17 08:22:02 EST 2004

On Dec 17, 2004, at 16:09, Todd Miller wrote:

>> Is there another way to make ufuncs work with user-defined classes 
>> and types?
> Not that I know of.  How critical a feature is it?  Do you have a work 
> around?

It is critical for some applications, though not for many.

The most important application in ScientificPython is automatic 
derivatives. These are implemented as a number-like class whose 
instances store the values of a variable and of its derivatives. Such 
objects can be fed to any routine that does mathematical calculations, 
which is what makes it so powerful. Without this mechanism, all 
function applications would have to be written as method calls, which 
is less habitual, but more importantly creates code that doesn't work 
with plain numbers.

> numarray ufunc handling is in flux as I'm adding numarray support to
> scipy.  At some point,  there's going to be a major ufunc 
> consolidation,
> and perhaps I can add this additional feature then.

Sounds good. I'll postpone the ScientificPython update until then.

Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: hinsen at llb.saclay.cea.fr

More information about the NumPy-Discussion mailing list