Hi, I've been lurking for a while, and using Numeric for about 5-6 months. I submitted a bug report about two months ago (https://sourceforge.net/tracker/index.php?func=detail&aid=594761&group_id=1369&atid=101369) regarding incorrect underflow behavior in exp(). I'd really like to get that fixed, nobody else seems to be working on it, and so I checked out the CVS tree. From reading the API section of the manual, I can see that unary ufuncs are driven by PyUFunc_FromFuncAndData() and that exp already has check_return set to 1, so that it should clean up rank-0 arrays, and raise the appropriate Python exception when 'errno' is set by a math error. I'd like to take a closer look into things, and one way of doing that would be to use a unit-test suite, but it's not obvious where that is (if at all) in the source distribution. Is there one? Another way to look into it would be if I could write some C code, then drop into Numeric's code and track what's going on when I call exp() for arguments that underflow. Is there a harness out there that I could just adapt to my own needs. Surely that's how other developers do it. If not, how *do* you fix bugs? I've already added some features to JNumeric, and introduced a unit-test suite there. I have so few problems using Numeric, I'd really like to nail this one involving exp(), since it's holding me back. Thanks, -Frank Gibbons PhD, Computational Biologist, Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA. Tel: 617-432-3555 Fax: 617-432-3557 http://llama.med.harvard.edu/~fgibbons
Hi,
I've been lurking for a while, and using Numeric for about 5-6 months. I submitted a bug report about two months ago (https://sourceforge.net/tracker/index.php?func=detail&aid=594761&group_id=1369&atid=101369) regarding incorrect underflow behavior in exp().
My understanding is that this bug went away with a new version of Python. It came about due to some change in Python and has not gone away. My advice is to start using scipy (but of course that's my advice because that's what I do). Or at least start using scipy_base (which is easier to install). SciPy handles NAN's and INFS instead of raising errors and this particular "bug" is not present because the error is not checked for.
Another way to look into it would be if I could write some C code, then drop into Numeric's code and track what's going on when I call exp() for arguments that underflow. Is there a harness out there that I could just adapt to my own needs. Surely that's how other developers do it. If not, how *do* you fix bugs?
What's going on is that the system library for exp() is raising an underflow error and rather than ignore it and return 0.0 like a good exp() function, the error propagates to the top. It's an annoying bug, I agree. I've heard that it disappears with a new version of Python (2.2) but, I'm not entirely sure because I use scipy_base extensively. -Travis O.
participants (2)
-
Frank Gibbons
-
Travis Oliphant