[SciPy-dev] stat.models.robust.scale test failure

Matthew Brett matthew.brett@gmail....
Thu Jan 3 11:46:18 CST 2008


Hi,

I guess this one's mainly for Jonathan...

I'm just moving the scipy testing framework over to nose testing, and
came across a couple of test failures in scipy.stats.models in tests
that the numpy testing did not appear to pick up.  Output appended.
Is the fix obvious?  I will have a go later today if nothing comes
immediately to mind...

Thanks a lot,

Matthew

======================================================================
ERROR: test_huber (test_scale.TestScale)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/tests/test_scale.py",
line 35, in test_huber
    m = scale.huber(X)
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/robust/scale.py",
line 82, in __call__
    for donothing in self:
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/robust/scale.py",
line 102, in next
    scale = N.sum(subset * (a - mu)**2, axis=self.axis) / (self.n *
Huber.gamma - N.sum(1. - subset, axis=self.axis) * Huber.c**2)
  File "/home/mb312/lib64/python2.5/site-packages/numpy/core/fromnumeric.py",
line 866, in sum
    return sum(axis, dtype, out)
TypeError: only length-1 arrays can be converted to Python scalars

======================================================================
ERROR: test_huberaxes (test_scale.TestScale)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/tests/test_scale.py",
line 40, in test_huberaxes
    m = scale.huber(X, axis=0)
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/robust/scale.py",
line 82, in __call__
    for donothing in self:
  File "/home/mb312/dev_trees/testing_cleanup/scipy/stats/models/robust/scale.py",
line 102, in next
    scale = N.sum(subset * (a - mu)**2, axis=self.axis) / (self.n *
Huber.gamma - N.sum(1. - subset, axis=self.axis) * Huber.c**2)
  File "/home/mb312/lib64/python2.5/site-packages/numpy/core/fromnumeric.py",
line 866, in sum
    return sum(axis, dtype, out)
TypeError: only length-1 arrays can be converted to Python scalars

----------------------------------------------------------------------
Ran 42 tests in 2.012s


More information about the Scipy-dev mailing list