scipy/scipy — pull request #3616 by Eric89GXL (2014-05-06 00:34:47+00:00)
Title: FIX: Invalid values

Closes #3579.

Even under this PR, I still have the following errors. I'm happy to catch the warnings for `anneal` being deprecated -- would the best thing to do just be `with warnings.catch_warnings():` and make the call, or is there a better / more `scipy`/`numpy` way to do it? The other errors, I'm not sure what is going on.

```
======================================================================
ERROR: Anneal: test for Boltzmann schedule
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 70, in test_boltzmann
retval = self.anneal_schedule('boltzmann', use_wrapper)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 56, in anneal_schedule
schedule=schedule, disp=False)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/lib/utils.py", line 94, in newfunc
warnings.warn(depdoc, DeprecationWarning)
DeprecationWarning: `anneal` is deprecated!
Deprecated in scipy 0.14.0, use basinhopping instead

======================================================================
ERROR: Anneal: test for Cauchy schedule
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 76, in test_cauchy
retval = self.anneal_schedule('cauchy', use_wrapper)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 56, in anneal_schedule
schedule=schedule, disp=False)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/lib/utils.py", line 94, in newfunc
warnings.warn(depdoc, DeprecationWarning)
DeprecationWarning: `anneal` is deprecated!
Deprecated in scipy 0.14.0, use basinhopping instead

======================================================================
ERROR: Anneal: test for fast schedule
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 64, in test_fast
retval = self.anneal_schedule('fast', use_wrapper)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 56, in anneal_schedule
schedule=schedule, disp=False)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/lib/utils.py", line 94, in newfunc
warnings.warn(depdoc, DeprecationWarning)
DeprecationWarning: `anneal` is deprecated!
Deprecated in scipy 0.14.0, use basinhopping instead

======================================================================
ERROR: minimize with 'anneal' method
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 82, in test_minimize
self.test_fast(True)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 64, in test_fast
retval = self.anneal_schedule('fast', use_wrapper)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/tests/test_anneal.py", line 50, in anneal_schedule
options=opts)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/optimize/_minimize.py", line 348, in minimize
DeprecationWarning)
DeprecationWarning: Method anneal is deprecated in scipy 0.14.0

======================================================================
ERROR: test_sparsetools.TestInt32Overflow.test_csr_matmat
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/sparse/tests/test_sparsetools.py", line 238, in test_csr_matmat
assert_raises(RuntimeError, a.dot, b)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 1047, in assert_raises
return nose.tools.assert_raises(*args,**kwargs)
File "/usr/lib/python2.7/unittest/case.py", line 475, in assertRaises
callableObj(*args, **kwargs)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/sparse/base.py", line 246, in dot
return self * other
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/sparse/base.py", line 309, in __mul__
return self._mul_sparse_matrix(other)
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/sparse/compressed.py", line 490, in _mul_sparse_matrix
indices = np.empty(nnz, dtype=idx_dtype)
MemoryError

======================================================================
FAIL: test_lorentz (test_odr.TestODR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/odr/tests/test_odr.py", line 293, in test_lorentz
3.7798193600109009e+00]),
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 836, in assert_array_almost_equal
precision=decimal)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 660, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 6 decimals

(mismatch 100.0%)
x: array([ 1.000000e+03, 1.000000e-01, 3.800000e+00])
y: array([ 1.430678e+03, 1.339051e-01, 3.779819e+00])

======================================================================
FAIL: test_multi (test_odr.TestODR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/odr/tests/test_odr.py", line 190, in test_multi
0.5101147161764654, 0.5173902330489161]),
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 836, in assert_array_almost_equal
precision=decimal)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 660, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 6 decimals

(mismatch 100.0%)
x: array([ 4. , 2. , 7. , 0.4, 0.5])
y: array([ 4.379988, 2.433306, 8.002885, 0.510115, 0.51739 ])

======================================================================
FAIL: test_pearson (test_odr.TestODR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/odr/tests/test_odr.py", line 236, in test_pearson
np.array([5.4767400299231674, -0.4796082367610305]),
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 836, in assert_array_almost_equal
precision=decimal)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 660, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 6 decimals

(mismatch 100.0%)
x: array([ 1., 1.])
y: array([ 5.47674 , -0.479608])

======================================================================
FAIL: test_trim (test_mstats_basic.TestTrimming)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/larsoner/.local/lib/python2.7/site-packages/scipy/stats/tests/test_mstats_basic.py", line 277, in test_trim
assert_equal(trimx._mask.ravel(), expected)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/ma/testutils.py", line 123, in assert_equal
return assert_array_equal(actual, desired, err_msg)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/ma/testutils.py", line 196, in assert_array_equal
header='Arrays are not equal')
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/ma/testutils.py", line 189, in assert_array_compare
verbose=verbose, header=header)
File "/home/larsoner/.local/lib/python2.7/site-packages/numpy/testing/utils.py", line 660, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 9.09090909091%)
x: array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, False, False, False, False, False, False, False,...
y: array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...

----------------------------------------------------------------------
```