Numpy scipy.test()失败,并出现许多断言错误

Numpy scipy.test()失败,并出现许多断言错误,numpy,python-3.x,scipy,macports,Numpy,Python 3.x,Scipy,Macports,对Scipy来说是新的 我已经安装了scipy和numpy,但是在运行scipy.test()时,我发现很多测试都失败了。 我试图找到一些共同的原因,我发现了几个: >>> import scipy >>> scipy.test() Running unit tests for scipy NumPy version 1.6.2 NumPy is installed in /opt/local/Library/Frameworks/Python.framewo

对Scipy来说是新的

我已经安装了scipy和numpy,但是在运行scipy.test()时,我发现很多测试都失败了。 我试图找到一些共同的原因,我发现了几个:

>>> import scipy
>>> scipy.test()
Running unit tests for scipy
NumPy version 1.6.2
NumPy is installed in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy
SciPy version 0.10.1
SciPy is installed in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy
Python version 2.7.3 (default, Apr 19 2012, 00:55:09) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]
nose version 1.1.2
...

AssertionError:
Arrays are not almost equal to 7 decimals
...
AssertionError:
Not equal to tolerance rtol=1e-10, atol=1e-305
...
AssertionError: 
Arrays are not almost equal to 4 decimals
...
AssertionError: 
Max |adiff|: 92783.6
Max |rdiff|: 0.353942
听起来像是MPI问题之类的,但我真的不知道

任何帮助都将不胜感激

最好的,乔纳森

--------编辑--------- 使用scipy.test尝试了它(verbose=10)。 大多数测试似乎都很好。 失败从一个错误开始。这就是我得到的:

   ERROR: Failure: DeprecationWarning (
The scipy.maxentropy module is deprecated in scipy 0.10, and scheduled to be
removed in 0.11.

If you are using some of the functionality in this module and are of the
opinion that it should be kept or moved somewhere - or you are even interested
to maintain/improve this whole module - please ask on the scipy-dev mailing
list.

The logsumexp function has already been moved to scipy.misc.)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/maxentropy/__init__.py", line 19, in <module>
    DeprecationWarning)
DeprecationWarning: 
The scipy.maxentropy module is deprecated in scipy 0.10, and scheduled to be
removed in 0.11.

If you are using some of the functionality in this module and are of the
opinion that it should be kept or moved somewhere - or you are even interested
to maintain/improve this whole module - please ask on the scipy-dev mailing
list.

The logsumexp function has already been moved to scipy.misc.

======================================================================
FAIL: test_asum (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/lib/blas/tests/test_blas.py", line 58, in test_asum
    assert_almost_equal(f([3,-4,5]),12)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 12

======================================================================
FAIL: test_dot (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/lib/blas/tests/test_blas.py", line 67, in test_dot
    assert_almost_equal(f([3,-4,5],[2,5,1]),-9)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: -9

======================================================================
FAIL: test_nrm2 (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/lib/blas/tests/test_blas.py", line 78, in test_nrm2
    assert_almost_equal(f([3,-4,5]),math.sqrt(50))
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 7.0710678118654755

======================================================================
FAIL: test_basic.TestNorm.test_overflow
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_basic.py", line 581, in test_overflow
    assert_almost_equal(norm(a), a)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 451, in assert_almost_equal
    return assert_array_almost_equal(actual, desired, decimal, err_msg)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 846, in assert_array_almost_equal
    header=('Arrays are not almost equal to %d decimals' % decimal))
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 677, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals

(mismatch 100.0%)
 x: array(-0.0)
 y: array([  1.00000002e+20], dtype=float32)

======================================================================
FAIL: test_basic.TestNorm.test_stable
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_basic.py", line 586, in test_stable
    assert_almost_equal(norm(a) - 1e4, 0.5)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: -10000.0
 DESIRED: 0.5

======================================================================
FAIL: test_basic.TestNorm.test_types
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_basic.py", line 568, in test_types
    assert_allclose(norm(x), np.sqrt(14), rtol=tol)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 1213, in assert_allclose
    verbose=verbose, header=header)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 677, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=2.38419e-06, atol=0

(mismatch 100.0%)
 x: array(1.0842021724855044e-19)
 y: array(3.7416573867739413)

======================================================================
FAIL: test_asum (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_blas.py", line 99, in test_asum
    assert_almost_equal(f([3,-4,5]),12)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 12

======================================================================
FAIL: test_dot (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_blas.py", line 109, in test_dot
    assert_almost_equal(f([3,-4,5],[2,5,1]),-9)
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: -9

======================================================================
FAIL: test_nrm2 (test_blas.TestFBLAS1Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_blas.py", line 127, in test_nrm2
    assert_almost_equal(f([3,-4,5]),math.sqrt(50))
  File "/Library/Python/2.7/site-packages/numpy/testing/utils.py", line 467, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 7.0710678118654755

----------------------------------------------------------------------
Ran 5101 tests in 56.140s


FAILED (KNOWNFAIL=12, SKIP=42, errors=1, failures=9)
<nose.result.TextTestResult run=5101 errors=1 failures=9>
错误:失败:弃用警告(
scipy 0.10中不推荐使用scipy.maxentropy模块,并计划使用该模块
在0.11中删除。
如果您正在使用本模块中的某些功能,并且
认为它应该保存或移动到某个地方——或者你甚至感兴趣
要维护/改进整个模块,请在scipy-dev邮件中询问
列表
logsumexp函数已移动到scipy.misc。)
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
loadTestsFromName中的第390行文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/nose/loader.py”
addr.filename,addr.module)
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/nose/importer.py”,第39行,在importFromPath中
返回self.importFromDir(目录路径,fqname)
importFromDir中的第86行文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/nose/importer.py”
mod=加载模块(部件名称、fh、文件名、描述)
文件“/usr/local/cillar/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/maxentropy/_________.py”,第19行
弃用警告)
弃用警告:
scipy 0.10中不推荐使用scipy.maxentropy模块,并计划使用该模块
在0.11中删除。
如果您正在使用本模块中的某些功能,并且
认为它应该保存或移动到某个地方——或者你甚至感兴趣
要维护/改进整个模块,请在scipy-dev邮件中询问
列表
logsumexp函数已移动到scipy.misc。
======================================================================
失败:测试asum(测试blas.TestFBLAS1Simple)
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/lib/blas/tests/test_blas.py”,第58行,在test_asum中
断言几乎相等(f([3,-4,5]),12)
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第467行,断言几乎等于
引发断言错误(msg)
断言者错误:
数组几乎不等于7位小数
实际值:0.0
期望:12
======================================================================
失败:测试点(测试blas.TestFBLAS1Simple)
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/lib/blas/tests/test_blas.py”,第67行,测试点
断言几乎相等(f([3,-4,5],[2,5,1]),-9)
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第467行,断言几乎等于
引发断言错误(msg)
断言者错误:
数组几乎不等于7位小数
实际值:0.0
所需:-9
======================================================================
失败:测试nrm2(测试blas.TESTFBLAS1简单)
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/lib/blas/tests/test_blas.py”,第78行,在test_nrm2中
断言几乎相等(f([3,-4,5]),数学sqrt(50))
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第467行,断言几乎等于
引发断言错误(msg)
断言者错误:
数组几乎不等于7位小数
实际值:0.0
所需:7.0710678118654755
======================================================================
失败:test\u basic.TestNorm.test\u溢出
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
runTest中的文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/nose/case.py”,第197行
自检(*self.arg)
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/linalg/tests/test_basic.py”,第581行,在test_溢出中
断言几乎相等(范数(a),a)
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第451行,断言几乎等于
返回断言数组几乎相等(实际值、期望值、小数、错误消息)
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第846行,断言数组几乎相等
标头=('数组几乎不等于%d个小数''%decimal'))
文件“/Library/Python/2.7/site packages/numpy/testing/utils.py”,第677行,在assert\u array\u compare中
引发断言错误(msg)
断言者错误:
数组几乎不等于7位小数
(100.0%)
x:阵列(-0.0)
y:数组([1.0000000 2E+20],dtype=float32)
======================================================================
失败:test_basic.TestNorm.test_stable
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
runTest中的文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/nose/case.py”,第197行
自检(*self.arg)
文件“/usr/local/ceral/python/2.7.3/Frameworks/python.framework/Versions/2.7/lib/python2.7/site packages/scipy/linalg/tests/test_basic.py”,第586行,位于test_stable中
断言几乎相等(范数)