1

Pythonパッケージstatsmodelsを(pipを使用して)ダウンロードしてテストを実行したところ、いくつかがゲートから失敗していることがわかりました。テストコマンドは

>>> import statsmodels.api as sm
>>> sm.test()

2つのエラーと1つの失敗があります。

=====================================================================
ERROR: statsmodels.sandbox.panel.test_sandwich.test_cov_cluster_2groups
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python2.7/site-packages/statsmodels/sandbox/panel/test_sandwich.py", line 30, in test_cov_cluster_2groups
    cov01, covg, covt = sw.cov_cluster_2groups(res, group, group2=time)
  File "/usr/local/lib/python2.7/site-packages/statsmodels/sandbox/panel/sandwich_covariance.py", line 555, in cov_cluster_2groups
    group_intersection = Group(group)
  File "/usr/local/lib/python2.7/site-packages/statsmodels/tools/grouputils.py", line 182, in __init__
    uni, uni_idx, uni_inv = combine_indices(group)
  File "/usr/local/lib/python2.7/site-packages/statsmodels/tools/grouputils.py", line 60, in combine_indices
    return_inverse=True)
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/arraysetops.py", line 178, in unique
perm = ar.argsort(kind='mergesort')
TypeError: requested sort not available for type

======================================================================
ERROR: statsmodels.tsa.base.tests.test_datetools.test_infer_freq
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
  File "/usr/local/lib/python2.7/site-packages/statsmodels/tsa/base/tests/test_datetools.py", line 63, in test_infer_freq
    npt.assert_string_equal(_infer_freq(b), 'B')
  File "/usr/local/lib/python2.7/site-packages/statsmodels/tsa/base/datetools.py", line 234, in _infer_freq
    elif delta >= timedelta(28*nobs) and delta <= timedelta(31*nobs):
TypeError: ufunc 'greater_equal' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'

======================================================================
FAIL: test_monotone_fn_inverter (statsmodels.distributions.tests.test_ecdf.TestDistributions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/statsmodels/distributions/tests/test_ecdf.py", line 41, in test_monotone_fn_inverter
    npt.assert_array_equal(f.y, x[::1])
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 707, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 636, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 15.,  14.,  13.,  12.,  11.,  10.,   9.,   8.,   7.,   6.])
 y: array([ 6,  7,  8,  9, 10, 11, 12, 13, 14, 15])

----------------------------------------------------------------------
Ran 1454 tests in 67.411s

その他の役立つ情報:

  • statsmodel v0.4.0(また試したv0.5.0
  • numpy v1.6.2
  • scipy v0.10.1
  • これらのパッケージはすべてピップされました
  • python v2.7.3homebrewを使用してMacOSX10.8にインストールされますbrew install python(つまり、OSXネイティブPythonではありません)。
  • 他にもいくつかのパッケージをピップしました:joblib v0.6.4、、、。テストに必要であり、に必要です。テストスイートは、並列実行に必要であると不満を漏らしました。nose v1.1.2patsy v0.1.0Nosepatsyimport statsmodels.apijoblib

最初の2つのエラーをどうすればよいかわかりません。失敗は少し奇妙に見えます。実装の変更などのようですが、statsmodelsの男/ギャルは、呼び出す前にテストを実行したと思われます。 1日:)では、ここで何が起こっているのでしょうか。

4

1 に答える 1

1

最新リリースhttp://pypi.python.org/pypi/statsmodels/0.4.3をお試しください

私が覚えている限り、これらのエラーはすべて修正されています。

最初のエラーは、1.6.2でのnumpyの動作の変更です。

2つ目は、新しいパンダバージョンで新しいnumpy dtypeを使用するように移行したことによる、日時処理の変更に関連していると思います。

最後はテストの間違いでした。

メーリングリストまたは課題追跡システムは、これらのテストの失敗を報告するのに適した場所である可能性があります:http: //groups.google.com/group/pystatsmodels https://github.com/statsmodels/statsmodels/issues

于 2012-08-29T00:57:39.690 に答える