[Numpy-discussion] unittest for np.random.poisson with lambda=0

Sebastian Haase seb.haase at gmail.com
Wed Nov 11 16:47:48 EST 2009


Thanks Robert,
Just for the archive: I hope the problem I was thinking of is what is
referred to here:
http://mail.scipy.org/pipermail/numpy-discussion/2005-July/004992.html
i.e. it should have been fixed as bug #1123145 in Numeric.

(see also here:
https://nanohub.org/infrastructure/rappture-runtime/browser/trunk/Numeric-24.2/changes.txt?rev=42
)

I still haven't learned how to write unittests .... (sorry)

- Sebastian Haase


On Wed, Nov 11, 2009 at 8:53 PM, Robert Kern <robert.kern at gmail.com> wrote:
> On Wed, Nov 11, 2009 at 02:30, Sebastian Haase <seb.haase at gmail.com> wrote:
>> Hi,
>> maybe this is an obsolete concern,
>> but at some point in the past
>> N.random.poisson would not always return 0 for lambda being zero.
>> (My post at the time should be in the (numarray)  list archive)
>>
>> So the question is, is this still a valid concern for the current numpy?
>
> No.
>
>> Could there a unittest added that does something like this:
>>
>>>>> a=N.random.poisson(0, 10000)
>>>>> N.alltrue(a==0)
>> True
>
> Write up a patch.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list