[SciPy-user] scipy.f2py issues
fonnesbeck at gmail.com
Sat Nov 5 13:33:57 CST 2005
On 11/4/05, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> Chris Fonnesbeck wrote:
> >Again, not sure if this belongs on this list or the f2py list, but here goes.
> >Delving deeper into the f2py array handling issue from my previous
> >post, I get a very strange result using a Numeric array with an f2py
> >module. The function _poisson() is simply an f2py function that
> >returns the log-likelihood of a poisson distribution for particular
> >passed values. Here is what happens:
> >(Pdb) _poisson([3.],[4.])
> >Out: -1.6328763961791992
> >(Pdb) _poisson(array([3.]),[4.])
> >Out: -19775746048.0
> >Why should a list and an array return different values? Ten orders of
> >magnitude different!
> Good question. They should both be converted to the same thing
> internally (an ndarray). Apparently they are not. We'll look into this.
The PyMC package that I sent you regarding the possible memory leak in
scipy_core also contains the _poisson f2py function (called from
poisson_likelihood), if you want to check it out.
More information about the SciPy-user