<p dir="auto">I get wrong numerical results (real component is off, imaginary component always near underflow) for <code class="notranslate">sph_harm</code> for scipy 0.16.0 that comes with Miniconda3. scipy on Miniconda seems OK.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Python 3.4.3 |Continuum Analytics, Inc.| (default, Oct 19 2015, 21:52:17) 
IPython 4.0.0 -- An enhanced Interactive Python.
In [1]: from scipy.special import sph_harm
In [2]: sph_harm(2,5,0.2,0.5)
Out[2]: (0.44798449902914189+3.1149082468549677e-310j)

Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:50:01) 
IPython 4.0.0 -- An enhanced Interactive Python.
In [1]: from scipy.special import sph_harm
In [2]: sph_harm(2,5,0.2,0.5)
Out[2]: (0.41262104797366594+0.17445338099189969j)"><pre class="notranslate"><code class="notranslate">Python 3.4.3 |Continuum Analytics, Inc.| (default, Oct 19 2015, 21:52:17) 
IPython 4.0.0 -- An enhanced Interactive Python.
In [1]: from scipy.special import sph_harm
In [2]: sph_harm(2,5,0.2,0.5)
Out[2]: (0.44798449902914189+3.1149082468549677e-310j)

Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:50:01) 
IPython 4.0.0 -- An enhanced Interactive Python.
In [1]: from scipy.special import sph_harm
In [2]: sph_harm(2,5,0.2,0.5)
Out[2]: (0.41262104797366594+0.17445338099189969j)
</code></pre></div>
<p dir="auto"><code class="notranslate">conda list</code> reports for Miniconda3 and Miniconda respectively</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="scipy                     0.16.0              np110py34_1 
scipy                     0.16.0               np19py27_1"><pre class="notranslate"><code class="notranslate">scipy                     0.16.0              np110py34_1 
scipy                     0.16.0               np19py27_1
</code></pre></div>
<p dir="auto">(I have not updated the scipy version in a while for Python2.)</p>
<p dir="auto">Kind of similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="77773362" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/4887" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/4887/hovercard" href="https://github.com/scipy/scipy/issues/4887">#4887</a>, I found an inconsistency in <code class="notranslate">sph_harm</code>, but it appears on Python 3.4 (e.g., on Anaconda scipy=0.16 or scipy=0.15) but not on Python 2.7 with equivalent <code class="notranslate">numpy</code>/<code class="notranslate">scipy</code> versions. Running this command in a Python 3.4 Anaconda virtual environment I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -c &quot;from scipy.special import sph_harm; print(sph_harm(1, 1, 1., 1.))&quot;
(-0.290723302201-2.02129965364e-310j)"><pre class="notranslate"><code class="notranslate">$ python -c "from scipy.special import sph_harm; print(sph_harm(1, 1, 1., 1.))"
(-0.290723302201-2.02129965364e-310j)
</code></pre></div>
<p dir="auto">But the correct result is what I get on Python 2.7 (verified using calculations from <a href="https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/maxwell.py#L251">here</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(-0.157078470549-0.24463522341j)"><pre class="notranslate"><code class="notranslate">(-0.157078470549-0.24463522341j)
</code></pre></div>
<p dir="auto">It does work on my system Python3 when using the Ubuntu-packaged scipy 0.14.1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(-0.15707847054880641-0.24463522340968866j)"><pre class="notranslate"><code class="notranslate">(-0.15707847054880641-0.24463522340968866j)
</code></pre></div>
<p dir="auto">And when I build <code class="notranslate">scipy</code> myself, latest <code class="notranslate">master</code> with MKL or <code class="notranslate">maintenance/0.16.x</code> using system BLAS, they both give the same correct result:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(-0.157078470549-0.24463522341j)"><pre class="notranslate"><code class="notranslate">(-0.157078470549-0.24463522341j)
</code></pre></div>
<p dir="auto">Any idea why it could break for 3.4 and not 2.7? And only some builds (apparently Anaconda)? This is a weird one.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jennystone/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jennystone">@jennystone</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/argriffing/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/argriffing">@argriffing</a> since you were on the last PR merge related to this<br>
cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wronk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wronk">@wronk</a></p>