[PYTHON MATRIX-SIG] Bugs in 1.0alpha1

Jim Hugunin hugunin@mit.edu
Mon, 12 Aug 1996 13:19:34 -0400

Carlos Fonseca wrote:
> On 11 Aug 1996, Janne Sinkkonen wrote:
> > I think the following may be bugs:

I appreciate the desire to be kind, but any time you can produce a core
dump with NumPy, you're entitled to say, I found the following TERRIBLE
BUG!  Though I'd prefer it if you sent these really obvious bugs
straight to me...

> > arange(5,3,2) produces a core dump. This seems to come down to (for
> > example) zeros((-5,)) producing a core dump.

> Version 0.36 produced some sort of empty array here.  Actually, this
> raises the question of the dimensions of empty arrays:
> empty arrays. I haven't run into difficulties with this, but expressions
> like b[1:1,:] and b[2:1,:] should work.

Empty arrays are now much cleaned up.  The reported bugs have been fixed
for alpha2 (sometime this week).  Note however, b[2:1, :] will not work
on an array of shape (2,3).  The reason this doesn't work should be
pretty clear.

For fun with empty arrays, try:

sum([[],[],[]], -1)

> > array() doesn't take a copy. Should it? (doc.html says it should)

It should and it does in alpha2.

> I had wondered about this, too. It also happens with b=ravel(a), if a is
> 1d, and may happen with other funtions, too. This may save space and time
> in some special cases, but it certainly isn't safe...  At least, it should
> be spelled out loud in the final docs.  Another possibility is an optional
> argument (something like b=ravel(a,alwayscopy=0/1)), but I don't know
> whether I like this or not.

I really don't like the idea of that optional argument, whether or not
these functions: reshape, ravel, and transpose should always return a
copy of their input array is a good question.  I'll think about this,
and will definately put a note in the docs if I decide to leave their
behavior unchanged.


MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org