[Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)
Tue Aug 31 09:13:13 CDT 2010
On Tue, Aug 31, 2010 at 7:02 AM, Ralf Gommers
> On Tue, Aug 31, 2010 at 3:44 AM, David Huard <email@example.com>wrote:
>> I just added a warning alerting concerned users (r8674), so this takes
>> care of the bug fix and Nils wish to avoid a silent change in behavior.
>> These two changes could be included in 1.5 if Ralf feels this is
>> That looks like a reasonable solution. I haven't got a strong opinion on
> whether or not to change the 'normed' keyword to 'density'.
> Looking at the changes, I don't think that is the right way to do the
> filtering in the tests. resetwarnings() removes all filters including the
> ones previously set by users, and should therefore not be used. Better to
> either raise a specific warning and filter on that, or to filter on the
> message content with:
> warnings.filterwarnings('ignore' , message="This release of NumPy fixes
> a normalization bug in histogram").
> I found one more place where resetwarnings() is used, in
> test_arraysetops.py, I'll change that in trunk. Related problem there is
> that the warning in warnings.warn is not a DeprecationWarning.
> The above problem is easy to fix, but in any case it's too late to go into
> 1.5.0 - I'll tag the final release tonight.
test_function_base and test_arraysetops now do not use resetwarnings. What I
did is added a warning filter and popped it out of the filters list
afterwards. Is this OK ?
In other tests, what is done is rather
but that will also override any user-defined setup, no ?
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion