Hi!

I just tried to install from source using instructions 
http://scikit-learn.org/stable/install.html I installed all packages and 
did "sudo pip install -U scikit-learn".
After installing did:

     python -c "import sklearn; sklearn.test()"

     Ran 993 tests in 35.552s
     FAILED (SKIP=6, errors=6)

I got 6 Doctests errors, all were in the same line of code. One example 
here.

     ERROR: Doctest: sklearn.datasets.base.load_sample_images
     ----------------------------------------------------------------------
     Traceback (most recent call last):
       File 
"/usr/local/lib/python2.7/dist-packages/nose/plugins/doctests.py", line 
395, in tearDown
         delattr(builtin_mod, self._result_var)
     AttributeError: _


I guess its not a big problem because its doctests and installation is 
ok? I looked at the source file 
"/usr/local/lib/python2.7/dist-packages/nose/plugins/doctests.py" and 
wonder some things:

     def tearDown(self):
         super(DocTestCase, self).tearDown()
         if self._result_var is not None:
             sys.displayhook = self._old_displayhook
             delattr(builtin_mod, self._result_var)

It seems that self._result_var is initialized to "_" in 
DocTestCase.__init__()
so self.result_var will never be None...because it is assigned in two 
places in this file, and
neither assigns None to it.

Perhaps better would be something like if hasattr(builtin_mod, 
self._result_var) ?
So it would protect using delattr() when there is no such attribute to 
delete...
I tried it and now I dont get DocTesterrors.

     def tearDown(self):
         super(DocTestCase, self).tearDown()
         #if self._result_var is not None:
         if hasattr(builtin_mod, self._result_var):
             sys.displayhook = self._old_displayhook
             delattr(builtin_mod, self._result_var)

Ran 993 tests in 34.766s

OK (SKIP=6)


- Joonas




------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to