[Numpy-discussion] Release of NumPy

Jarrod Millman millman@berkeley....
Tue Apr 15 03:32:06 CDT 2008


On Tue, Apr 15, 2008 at 12:56 AM, David Cournapeau
<david@ar.media.kyoto-u.ac.jp> wrote:
>  > Please keep in mind that there are a number of these "awkward"
>  > "wrong-default" arguments. I was hoping these would be unified [e.g.
>  > always same default, axis=None]  very soon  -- that is in 1.1.
>
>  Is this noted somewhere (e.g. is there a ticket for it ?). I think
>  unifying API is really important, and the only way to do it is to keep
>  track of those inconsistencies, so that we can decide what to do with them.

I agree that unifying the API is really important.  So I agree with
Robert that we need to be extremely conservative in breaking the API.
However, unifying the API is one area that I think could arguably
(depending on the specific case) justify breaking the existing API.

For instance, the 1.1.0 release, which will come out ASAP, introduces
'axis' support for numpy.median().  In 1.1, by default "axis=0" and
then in the 1.2.0 release, which will come out at the end of summer,
"axis=None" by default:
http://scipy.org/scipy/numpy/ticket/558

Another example of a potential API break has been proposed for histogram:
http://projects.scipy.org/pipermail/numpy-discussion/2008-April/032450.html
http://scipy.org/scipy/numpy/ticket/605

If someone could put together a list of instances like these that we
should discuss, it would be extremely useful.  We could potentially
try and put in warnings for functions that we want to modify.  Again
we need to be extremely careful here.  We should avoid breaking our
user's code as much as possible.

However, when our current API is "broken" we should be open to the
possibility that in may need to be fixed.  Functions with anomalous
interfaces seem like a good example of candidates that would be worth
modifying.  However, we need to consider whether the code is so widely
used that modifying it would unacceptable.  Furthermore, I would be
less concerned about modifying the interface to functions, if we can
also include an upgrade script that will automatically fix old code.
So, for example, we could include an upgrade script with 1.2, which
modifies calls to numpy.median() so that 'axis=0'.  That way our users
could upgrade their code to work with NumPy 1.2 by simply running the
upgrade script.

Thanks,

-- 
Jarrod Millman
Computational Infrastructure for Research Labs
10 Giannini Hall, UC Berkeley
phone: 510.643.4014
http://cirl.berkeley.edu/


More information about the Numpy-discussion mailing list