You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below is produced with numpy 1.9.0rc1 on an OpenBSD/i386 system.
Python 2.7.8 (default, Aug 27 2014, 00:06:02)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy.core.umath as ncu
>>> import numpy as np
>>> ncu.log1p(np.nan)
__main__:1: RuntimeWarning: invalid value encountered in log1p
nan
>>> np.log1p(np.nan)
nan
Not at a real computer so I can't check details but:
why are you surprised that calling log1p on a nan raises a warning?
I think ncu.log1p and np.log1p are the same object, and the only reason
that you get a warning for one and not the other is that by default
warnings are only issued once.
The below is produced with numpy 1.9.0rc1 on an OpenBSD/i386 system.
Python 2.7.8 (default, Aug 27 2014, 00:06:02)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
import numpy.core.umath as ncu
import numpy as np
ncu.log1p(np.nan) main:1: RuntimeWarning: invalid value encountered in log1p
nan
np.log1p(np.nan)
nan
—
Reply to this email directly or view it on GitHub #5017.
Thanks for taking a look. The reason it looked odd enough for me to report it is that this is the only code in the test suite that reports a RuntimeWarning on i386.
(and I confirmed that switching the order of np.log1p and ncu.log1p does indeed raise a warning only one time as was suspected.)
@didickman If it raises a warning in the test suite, we should deal with it. Can you determine which test is was? Might need to run the test with the verbosity turned up.
Look in the build directory for config.h and see if HAVE_LOG1PL is defined. I'm suspecting that it is missing from the gcc library and numpy is falling back on its own version.
Activity
charris commentedon Aug 29, 2014
This presence or this warning depends on the hardware/compiler, but is not unexpected for a
nanargument. Is it a problem for you?njsmith commentedon Aug 29, 2014
Not at a real computer so I can't check details but:
that you get a warning for one and not the other is that by default
warnings are only issued once.
The below is produced with numpy 1.9.0rc1 on an OpenBSD/i386 system.
Python 2.7.8 (default, Aug 27 2014, 00:06:02)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
—
Reply to this email directly or view it on GitHub
#5017.
didickman commentedon Aug 29, 2014
Thanks for taking a look. The reason it looked odd enough for me to report it is that this is the only code in the test suite that reports a RuntimeWarning on i386.
(and I confirmed that switching the order of np.log1p and ncu.log1p does indeed raise a warning only one time as was suspected.)
charris commentedon Aug 29, 2014
@didickman If it raises a warning in the test suite, we should deal with it. Can you determine which test is was? Might need to run the test with the verbosity turned up.
didickman commentedon Aug 29, 2014
From memory, I believe it's TestLog1p in ./numpy/core/tests/test_umath.py.
If you need me to confirm, a pointer how to turn verbosity up would be great.
charris commentedon Aug 29, 2014
Outside of the repo
or in the git repo
charris commentedon Aug 29, 2014
Look in the build directory for
config.hand see ifHAVE_LOG1PLis defined. I'm suspecting that it is missing from the gcc library and numpy is falling back on its own version.charris commentedon Aug 29, 2014
Or the gcc library is just old...
TST: Silence some warning that turns up on OpenBSD.
charris commentedon Aug 29, 2014
#5020 should silence the warning.
didickman commentedon Aug 30, 2014
Confirmed. The patch does indeed silence the warning. Thanks!