[pymvpa] PyMVPA for Python 3

Tiziano Zito opossumnano at gmail.com
Wed Apr 18 11:22:54 UTC 2012


dear PyVMPA devs,

as I accumulated a bit of experience in migrating projects from py2 to py3, 
I thought I could try to help doing this migration for PyMVPA too. 
I know it may seem premature, but now that numpy and (hopefully)
scipy and matplotlib will be available for py3 on at least on the
next releases of debian and ubuntu, I think there is some hope for
py3 in science. 

I am branching from master on github as of now (f0d900f1a1c715379dd716e3d4c87876b321ba9e).

I have two problems running the unittests. I am assuming that the
proper way of running the tests is simply running 'nosetests' in the
git checkout.

- I got three failures and one error: are they expected? is this a
  problem with my installation?

- how can I disable the matplotlib windows that pop up shortly
  during testing? as there is still no python3-matplotlib I would
  need to disable it for the moment

a typescript of the testing session is attached.


ciao,
tiziano

-------------- next part --------------
Script started on Wed 18 Apr 2012 01:15:51 PM CEST
$ pwd
/home/tiziano/git/PyMVPA
$ ls
3rd	 Changelog    Makefile.win  bin		 doc		setup.py
AUTHOR	 MANIFEST.in  README	    build	 mvpa2		tools
COPYING  Makefile     TODO	    build-stamp  setup.cfg.win	typescript
$ nosetests
......SSSS.........S................................................................................S......F..........S................S............/home/tiziano/git/PyMVPA/mvpa2/tests/test_kernel.py:151: PendingDeprecationWarning: Please use assertFalse instead.
  "CachedKernel incorrectly recomputed it's kernel")
.......S..................S........................E....................................S............/home/tiziano/git/PyMVPA/mvpa2/support/utils.py:90: DeprecationWarning: Function splitattr is deprecated; to be removed in PyMVPA 2.1; use .attr instead
  warnings.warn(msg, category=DeprecationWarning)
...................F./usr/lib/python2.7/dist-packages/scipy/stats/distributions.py:3286: DeprecationWarning: The `invnorm` distribution will be renamed to `invgauss` after scipy 0.9
  warnings.warn(_invnorm_msg, DeprecationWarning)
/usr/lib/python2.7/dist-packages/scipy/stats/distributions.py:3280: DeprecationWarning: The `invnorm` distribution will be renamed to `invgauss` after scipy 0.9
  warnings.warn(_invnorm_msg, DeprecationWarning)
can't invoke "event" command:  application has been destroyed
    while executing
"event generate $w <<ThemeChanged>>"
    (procedure "ttk::ThemeChanged" line 6)
    invoked from within
"ttk::ThemeChanged"
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x8fdf690>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),))
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x8fe2050>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),))
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x8fe2a50>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),))
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x8fe4490>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),))
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x8fe4e90>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),))
../home/tiziano/git/PyMVPA/mvpa2/tests/test_stats_sp.py:93: PendingDeprecationWarning: Please use assertAlmostEqual instead.
  self.failUnlessAlmostEqual(null.p(-100), p_100)
/home/tiziano/git/PyMVPA/mvpa2/tests/test_stats_sp.py:94: PendingDeprecationWarning: Please use assertAlmostEqual instead.
  self.failUnlessAlmostEqual(p100[0], p_100)
.......................SF.............................S...
======================================================================
ERROR: test_simple (mvpa2.tests.test_procrust.ProcrusteanMapperTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tiziano/git/PyMVPA/mvpa2/testing/sweepargs.py", line 67, in do_sweep
    method(*args_, **kwargs_)
  File "/home/tiziano/git/PyMVPA/mvpa2/testing/sweepargs.py", line 67, in do_sweep
    method(*args_, **kwargs_)
  File "/home/tiziano/git/PyMVPA/mvpa2/testing/tools.py", line 161, in newfunc
    return func(*arg, **kwargs)
  File "/home/tiziano/git/PyMVPA/mvpa2/tests/test_procrust.py", line 64, in test_simple
    pm.train(ds)
  File "/home/tiziano/git/PyMVPA/mvpa2/base/learner.py", line 121, in train
    result = self._train(ds)
  File "/home/tiziano/git/PyMVPA/mvpa2/mappers/procrustean.py", line 182, in _train
    from mvpa2.support.lapack_svd import svd as dgesvd
  File "/home/tiziano/git/PyMVPA/mvpa2/support/lapack_svd.py", line 11, in <module>
    lapacklib = cdll.LoadLibrary('liblapack.so')
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: liblapack.so: cannot open shared object file: No such file or directory

======================================================================
FAIL: mvpa2.tests.test_fxmapper.test_fx_native_calls
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 622, in newfunc
    return func(*arg, **kw)
  File "/home/tiziano/git/PyMVPA/mvpa2/tests/test_fxmapper.py", line 179, in test_fx_native_calls
    assert_array_equal(dsm1.samples, dsm2.samples)
  File "/usr/lib/pymodules/python2.7/numpy/testing/utils.py", line 707, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/lib/pymodules/python2.7/numpy/testing/utils.py", line 636, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
 Single scenario lead to failures of unittest test_fx_native_calls:
  on
    f=argsort :
     
Arrays are not equal

(mismatch 100.0%)
 x: array([[[1 2 3 0], [0], [0]],
       [[2 1 0 3], [0], [0]],
       [[1 0 2 3], [0], [0]],...
 y: array([[[1 2 3 0], [0], [0]],
       [[2 1 0 3], [0], [0]],
       [[1 0 2 3], [0], [0]],...
    f=cumprod :
     
Arrays are not equal

(mismatch 100.0%)
 x: array([[[  1.31124979e-01  -2.31706092e-02   3.00559750e-03   5.90789323e-05],
        [ 0.73489147], [ 0.21939494]],
       [[  2.12740242e-01   3.09864446e-02  -6.53228986e-05  -1.44369410e-05],...
 y: array([[[  1.31124979e-01  -2.31706092e-02   3.00559750e-03   5.90789323e-05],
        [ 0.73489147], [ 0.21939494]],
       [[  2.12740242e-01   3.09864446e-02  -6.53228986e-05  -1.44369410e-05],...
    f=cumproduct :
     
Arrays are not equal

(mismatch 100.0%)
 x: array([[[  1.31124979e-01  -2.31706092e-02   3.00559750e-03   5.90789323e-05],
        [ 0.73489147], [ 0.21939494]],
       [[  2.12740242e-01   3.09864446e-02  -6.53228986e-05  -1.44369410e-05],...
 y: array([[[  1.31124979e-01  -2.31706092e-02   3.00559750e-03   5.90789323e-05],
        [ 0.73489147], [ 0.21939494]],
       [[  2.12740242e-01   3.09864446e-02  -6.53228986e-05  -1.44369410e-05],...
    f=cumsum :
     
Arrays are not equal

(mismatch 100.0%)
 x: array([[[ 0.13112498 -0.04558132 -0.17529726 -0.15564096], [ 0.73489147],
        [ 0.21939494]],
       [[ 0.21274024  0.35839414  0.35628602  0.57729491], [ 0.36766818],...
 y: array([[[ 0.13112498 -0.04558132 -0.17529726 -0.15564096], [ 0.73489147],
        [ 0.21939494]],
       [[ 0.21274024  0.35839414  0.35628602  0.57729491], [ 0.36766818],...
    f=sort :
     
Arrays are not equal

(mismatch 100.0%)
 x: array([[[-0.1767063  -0.12971595  0.0196563   0.13112498], [ 0.73489147],
        [ 0.21939494]],
       [[-0.00210811  0.14565389  0.21274024  0.22100889], [ 0.36766818],...
 y: array([[[-0.1767063  -0.12971595  0.0196563   0.13112498], [ 0.73489147],
        [ 0.21939494]],
       [[-0.00210811  0.14565389  0.21274024  0.22100889], [ 0.36766818],...


======================================================================
FAIL: Test estimation of measures statistics
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tiziano/git/PyMVPA/mvpa2/tests/test_stats_sp.py", line 134, in test_dataset_measure_prob
    % (m.ca.null_t[0, ds.a.nonbogus_features]))
AssertionError: 
 Single scenario lead to failures of unittest test_dataset_measure_prob:
  on
    nd=FixedNullDist: 0 ca:ca{} :
     Nonbogus features should have high t-score. Got <Dataset: 1x2 at float64, <fa: fprob>>
    nd=FixedNullDist: 0 ca:ca{} :
     Nonbogus features should have high t-score. Got <Dataset: 1x2 at float64, <fa: fprob>>


======================================================================
FAIL: Test AUC computation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tiziano/git/PyMVPA/mvpa2/tests/test_transerror.py", line 314, in test_auc
    'AUC=%.2g among %s' % (mauc, stats['AUC']))
AssertionError: 
 Single scenario lead to failures of unittest test_auc:
  on
    clf=<kNN(k=5)> :
     All AUCs must be above chance. Got minimal AUC=nan among [nan, nan]
    clf=<kNN(k=5, voting='majority')> :
     All AUCs must be above chance. Got minimal AUC=nan among [nan, nan]
    clf=<kNN on SMLR(lm=1) non-0> :
     All AUCs must be above chance. Got minimal AUC=nan among [nan, nan]
    clf=<kNN on 5%(ANOVA)> :
     All AUCs must be above chance. Got minimal AUC=nan among [nan, nan]
    clf=<kNN on 50(ANOVA)> :
     All AUCs must be above chance. Got minimal AUC=nan among [nan, nan]


----------------------------------------------------------------------
Ran 330 tests in 185.383s

FAILED (SKIP=13, errors=1, failures=3)
$ 

Script done on Wed 18 Apr 2012 01:20:28 PM CEST


More information about the Pkg-ExpPsy-PyMVPA mailing list