[Numpy-discussion] The array interface published

Magnus Lie Hetland magnus at hetland.org
Tue Apr 5 01:49:25 CDT 2005


Scott Gilbert <xscottg at yahoo.com>:
>
[snip]
> > > Inconsistencies other than the array interface (e.g.  one implements
> > > argmax(x) while another implements x.argmax()) may mean that an
> > > extension module can work with one array implementation but not with
> > > another,
> > 
> > This does *not* sound like a good thing -- I agree. Certainly not what
> > I would hope this protocol is used for.
> > 
> 
> Things like argmax(x) are not part of this protocol.  The high level array
> packages and libraries will have all sorts of crazy and useful features.

Sure -- I realise that. I just mean that I hope there won't be several
scientific array modules that implement similar concepts with
different APIs, just because they can (because of the new array API).

> The protocol only describes the layout and format of the data.  It enables
> higher level packages to work seemlessly with all the different array
> objects. 

Exactly.

> That said, this protocol would allow a version argmax(x) to be
> written in such a way as to handle *any* array object.

... given that you can compare the values in the array, of course.
But, yes. This would be (IMO) the ideal situation. Instead of spawning
several equivalent-but-different scientific array modules (i.e. the
ones implementing such functionality as argmax()) we would have *one*
main, standard such module, whose operations would work with almost
any conceivable array object (e.g. from wxPython or PIL). That seems
like a very, very good situation, IMO.

> Cheers,
>     -Scott

-- 
Magnus Lie Hetland                    Fall seven times, stand up eight
http://hetland.org                                  [Japanese proverb]




More information about the Numpy-discussion mailing list