<p dir="auto">Just installed on MacOS from source (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="293652192" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/8353" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/8353/hovercard" href="https://github.com/scipy/scipy/issues/8353">#8353</a>). Did not install nose.<br>
<code class="notranslate">python3 runtests.py -v</code><br>
fails, reporting<br>
<code class="notranslate">!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!! </code><br>
without running any tests because<br>
<code class="notranslate">scipy/_lib/tests/test__gcutils.py</code> and<br>
<code class="notranslate">scipy/io/matlab/tests/test_mio5_utils.py</code><br>
try to import from <code class="notranslate">nose.tools</code>.<br>
Installing <code class="notranslate">nose</code> fixes the problem.</p>
<p dir="auto">Version of SciPy installed via pip doesn't have this problem. It collects over 14096 items without any errors.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python3 runtests.py -v"><pre class="notranslate"><code class="notranslate">python3 runtests.py -v
</code></pre></div>
<p dir="auto">or in Python console:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import scipy
scipy.test()"><pre class="notranslate"><code class="notranslate">import scipy
scipy.test()
</code></pre></div>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Matts-MacBook-Pro:scipy matthaberland$ python3 runtests.py -v
Building, see build.log...
Build OK (0:00:05.530066 elapsed)
============================= test session starts ==============================
platform darwin -- Python 3.6.4, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 -- /usr/local/opt/python3/bin/python3.6
cachedir: ../../../../../.pytest_cache
rootdir: /Users/matthaberland/Desktop/ScipyDev/scipy, inifile: pytest.ini
collected 13960 items / 2 errors                                               

==================================== ERRORS ====================================
 ERROR collecting build/testenv/lib/python3.6/site-packages/scipy/_lib/tests/test__gcutils.py 
ImportError while importing test module '/Users/matthaberland/Desktop/ScipyDev/scipy/build/testenv/lib/python3.6/site-packages/scipy/_lib/tests/test__gcutils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
scipy/_lib/tests/test__gcutils.py:9: in &lt;module&gt;
    from nose.tools import assert_equal, raises
E   ModuleNotFoundError: No module named 'nose'
 ERROR collecting build/testenv/lib/python3.6/site-packages/scipy/io/matlab/tests/test_mio5_utils.py 
ImportError while importing test module '/Users/matthaberland/Desktop/ScipyDev/scipy/build/testenv/lib/python3.6/site-packages/scipy/io/matlab/tests/test_mio5_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
scipy/io/matlab/tests/test_mio5_utils.py:13: in &lt;module&gt;
    from nose.tools import (assert_true, assert_equal, assert_raises)
E   ModuleNotFoundError: No module named 'nose'
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================= 570 tests deselected =============================
=================== 570 deselected, 2 error in 8.97 seconds ===================="><pre class="notranslate"><code class="notranslate">Matts-MacBook-Pro:scipy matthaberland$ python3 runtests.py -v
Building, see build.log...
Build OK (0:00:05.530066 elapsed)
============================= test session starts ==============================
platform darwin -- Python 3.6.4, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 -- /usr/local/opt/python3/bin/python3.6
cachedir: ../../../../../.pytest_cache
rootdir: /Users/matthaberland/Desktop/ScipyDev/scipy, inifile: pytest.ini
collected 13960 items / 2 errors                                               

==================================== ERRORS ====================================
 ERROR collecting build/testenv/lib/python3.6/site-packages/scipy/_lib/tests/test__gcutils.py 
ImportError while importing test module '/Users/matthaberland/Desktop/ScipyDev/scipy/build/testenv/lib/python3.6/site-packages/scipy/_lib/tests/test__gcutils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
scipy/_lib/tests/test__gcutils.py:9: in &lt;module&gt;
    from nose.tools import assert_equal, raises
E   ModuleNotFoundError: No module named 'nose'
 ERROR collecting build/testenv/lib/python3.6/site-packages/scipy/io/matlab/tests/test_mio5_utils.py 
ImportError while importing test module '/Users/matthaberland/Desktop/ScipyDev/scipy/build/testenv/lib/python3.6/site-packages/scipy/io/matlab/tests/test_mio5_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
scipy/io/matlab/tests/test_mio5_utils.py:13: in &lt;module&gt;
    from nose.tools import (assert_true, assert_equal, assert_raises)
E   ModuleNotFoundError: No module named 'nose'
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================= 570 tests deselected =============================
=================== 570 deselected, 2 error in 8.97 seconds ====================
</code></pre></div>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.0.0.dev0+f2c31e3 1.14.0 sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">1.0.0.dev0+f2c31e3 1.14.0 sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0)
</code></pre></div>
<p dir="auto">The current default ncv parameter for sparse.linalg.eigs() often leads to wrong answers.</p>
<p dir="auto">In the _ArpackParams class constructor, the ncv parameter is set to the bare minimum of 2*k + 1 (where k is the number of requested eigenvalues).<br>
<code class="notranslate">if ncv is None: ncv = 2 * k + 1</code><br>
This is often insufficient to obtain convergence of the requested eigenvalues, with different eigenvalues being returned instead.</p>
<p dir="auto">To avoid this issue, MATLAB and Julia both use a minimum of ncv=20 by default (see <a href="http://de.mathworks.com/help/matlab/ref/eigs.html" rel="nofollow">MATLAB's "p" option</a>). I think scipy would benefit from doing the same:<br>
<code class="notranslate">if ncv is None: ncv = min(20, 2 * k + 1)</code><br>
I think the small memory usage increase (ncv * size of a Krylov vector) is well worth it for correctness of the answers in cases like mine (see attachment). Also, as an added bonus, the speed of convergence can be greatly enhanced.</p>
<p dir="auto">I've attached a demonstration in the form of an ipython notebook, including test data:<br>
<a href="https://github.com/scipy/scipy/files/118285/ARPACK_test.zip">ARPACK_test.zip</a></p>