[Numpy-discussion] metadata and metabehavior for arrays (for scipy.base or Numeric3)

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Wed Apr 6 23:55:02 CDT 2005


On 07.04.2005, at 00:43, David M. Cooke wrote:

> I like this! It's got namespace goodness all over it (last Python zen
> line in 'import this': Namespaces are one honking great idea -- let's
> do more of those!)

Sounds like a good principle!

> 1) arrays. Here, we want efficient computation of functions applied to
>    lots of elements. That's where the output arguments and special
>    methods (.reduce, .accumulate, and .outer) are useful

All that is accessible if the class gets passed the ufunc object.

> 2) polymorphic functions. Output arguments aren't useful here. The
>    special methods are useful for binary ufuncs only.

Fine, then they just call the ufunc. And the rare cases that need  
explicit code for each ufunc (my Derivatives, for example) can retrieve  
the name of the ufunc and dispatch on it.

Konrad.
--
------------------------------------------------------------------------ 
-------
Konrad Hinsen
Laboratoire Leon 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: khinsen at cea.fr
------------------------------------------------------------------------ 
-------





More information about the Numpy-discussion mailing list