[Numpy-discussion] Uncomfortable with matrix change

Anne Archibald peridot.faceted at gmail.com
Sat May 10 16:05:38 EDT 2008


2008/5/10 Jarrod Millman <millman at berkeley.edu>:
> On Sat, May 10, 2008 at 8:14 AM, Keith Goodman <kwgoodman at gmail.com> wrote:
>>> If these are backed out, will some kind of deprecation
>>> warning be added for scalar indexing, as Travis suggested?
>>> Robert's request seems in accord with this.
>>
>> Shouldn't a deprecation warning explain what the future behavior will
>> be? Is there a firm consensus on what that behavior will be?
>
> I agree that a deprecation warning needs to explain the future
> behavior and don't believe we have agreed on what it should be yet.
>
> I don't personally have an opinion on the what the new behavior should
> be at this point.  But I don't think it makes sense to add deprecation
> warnings at this point--unless we know exactly what it is that we will
> be doing in the future.  So while it could be argued that it would be
> useful to say "use x[0,:] instead of x[0] to return row 0 as a matrix"
> in the 1.1 release, my sense is that we will still need to replace
> that DeprecationWarning in 1.2 with a new DeprecationWarning saying
> something like "in 1.3 x[0] will return .... and if you want .... you
> will need to call x[0,:]".  I don't think we should have two different
> DeprecationWarnings in back to back releases and believe that we
> should wait to include the warning until we decide what the new
> behavior will be in 1.2.

Regrettably I have to agree that we can't introduce a
DeprecationWarning until 1.2. I don't agree that x[0,:] should return
a matrix! It should be the one-dimensional object it looks like. See
Keith Goodman's recent message -
http://projects.scipy.org/pipermail/numpy-discussion/2008-May/033726.html
- for an example of why representing 1D objects as 2D objects is
trouble. I am of the opinion that matrix indexing should be identical
to array indexing, insofar as that is possible.

I don't expect my opinion to prevail, but the point is that we do not
even have enough consensus to agree on a recommendation to go in the
DeprecationWarning. Alas.

Anne



More information about the NumPy-Discussion mailing list