annoying Deprecation warnings about nonintegers
I'm trying to fix some code in statsmodels that creates Deprecation Warnings from numpy Most of it are quite easy to fix, mainly cases where we use floats to avoid integer division I have two problems first, I get Deprecation warnings in the test run that don't specify where they happen. I try to find them with file searches, but I don't see a `np.ones` that might cause a problem (needle in a haystack: Close to 4000 unittests and more than 100,000 lines of numpython) Also, I'm not sure the warnings are only from statsmodels, they could be in numpy, scipy or pandas, couldn't they? second, what's wrong with nonintegers in `np.r_[[np.nan] * head, x, [np.nan] * tail]` (see below) I tried to set the warnings filter to `error` but then Python itself errored right away. https://travisci.org/statsmodels/statsmodels/jobs/68748936 https://github.com/statsmodels/statsmodels/issues/2480 Thanks for any clues Josef
nosetests s pdbfailures pdb "M:\j\statsmodels\statsmodels_py34\statsmodels\tsa\tests"
..................C:\WinPython64bit3.4.3.1\python3.4.3.amd64\lib\sit epackages\numpy\core\numeric.py:183: DeprecationWarning: using a noninteger nu mber instead of an integer will result in an error in the future a = empty(shape, dtype, order) .......... .......M:\j\statsmodels\stat smodels_py34\statsmodels\tsa\filters\filtertools.py:28: DeprecationWarning: usin g a noninteger number instead of an integer will result in an error in the futu re return np.r_[[np.nan] * head, x, [np.nan] * tail] .......................... ...................C:\WinPython64bit3.4.3.1 \python3.4.3.amd64\lib\sitepackages\numpy\lib\twodim_base.py:231: DeprecationW arning: using a noninteger number instead of an integer will result in an error in the future m = zeros((N, M), dtype=dtype) C:\WinPython64bit3.4.3.1\python3.4.3.amd64\lib\sitepackages\numpy\l ib\twodim_base.py:238: DeprecationWarning: using a noninteger number instead of an integer will result in an error in the future m[:Mk].flat[i::M+1] = 1 ...........
On Jun 30, 2015 9:01 PM,
I'm trying to fix some code in statsmodels that creates Deprecation
Warnings from numpy
Most of it are quite easy to fix, mainly cases where we use floats to
avoid integer division
I have two problems
first, I get Deprecation warnings in the test run that don't specify
I try to find them with file searches, but I don't see a `np.ones` that might cause a problem (needle in a haystack: Close to 4000 unittests and more than 100,000
where they happen. lines of numpython)
Also, I'm not sure the warnings are only from statsmodels, they could be in numpy, scipy or pandas, couldn't they?
second, what's wrong with nonintegers in `np.r_[[np.nan] * head, x, [np.nan] * tail]` (see below)
I tried to set the warnings filter to `error` but then Python itself errored right away.
I'd try using a more targeted error filter. Python trends to spit out a bunch of ImportWarnings on startup. You can make a warnings filter that does "error" but only for DeprecationWarning. Or only for DeprecationWarning matching the regexp "noninteger". n
participants (2)

josef.pktd＠gmail.com

Nathaniel Smith