[Numpy-discussion] numpy release

David Huard david.huard at gmail.com
Thu Apr 24 14:22:41 EDT 2008


The problem I see with C is that it will break compatibility with the other
histogram functions, which also use bins.

So here is suggestion E:

The most common use case ( I think) is the following:
h, b = histogram(r, number_of_bins, normed=True/False) for which the
function behaves correctly.

Assuming we want the next version to : ignore values outside of range and
accept and return the bin edges instead of the left edges, here could be the
new signature for 1.1:
h, edges = histogram(a, bins=10, normed=False, range=None, normed=False,
new=False)

If new=False, return the histogram and the left edges, with a warning that
in the next version, the edges will be returned. If new=True, return the
histogram and the edges.
If range is given explicitly , raise a warning saying that in the next
version, the outliers will be ignored.  To ignore outliers, use new=True.
If bins is a sequence, raise an error saying that bins should be an integer.
To use explicit edges, use new=True.

In 1.2, set new=True as the default, and in 2.3, remove new altogether.


David

2008/4/24 Travis E. Oliphant <oliphant at enthought.com>:

> Pauli Virtanen wrote:
> >
> >   C) Create a new parameter with more sensible behavior and a name
> > different from "bins", and deprecate (at least giving sequences to) the
> > "bins" parameter: put up a DeprecationWarning if the user does this, but
> > still produce the same results as the old histogram. This way the user
> > can forward-port her code at leisure.
> >
>
>
> >   D) Or, retain the old behavior (values below lowest bin ignored) and
> > just fix the docstring and the normed=True bug? (I have a patch doing
> > this.)
> >
> >
> > So which one (or something else) do we choose for 1.1.0?
> >
> >
> I like either C or D,  but prefer C if it can be done before 1.1.0.
>
> -Travis
>
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080424/e5fc3964/attachment.html>


More information about the NumPy-Discussion mailing list