<p dir="auto">I am finding that running numpy.convolve with versions &gt;= 1.14.6 automatically launches the job on all available CPUs/threads. Is this bug? This is not the behavior for numpy &lt;= 1.14.5.</p>
<h3 dir="auto">Reproducing code example:</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
movingAvg = np.convolve(data, window, &quot;same&quot;)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">movingAvg</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">convolve</span>(<span class="pl-s1">data</span>, <span class="pl-s1">window</span>, <span class="pl-s">"same"</span>)</pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<p dir="auto">('1.14.6', '2.7.12 (default, Nov 12 2018, 14:36:49) \n[GCC 5.4.0 20160609]')</p>
<p dir="auto">This is not a bug report but just an enhancement proposal.</p>
<p dir="auto">I think it would be useful and important to be able to easily set the number of threads used by Numpy after Numpy import.</p>
<p dir="auto">From the perspective of library developers, it is often useful to be able to control the number of threads used by Numpy, see for example <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="260791342" data-permission-text="Title is private" data-url="https://github.com/biopython/biopython/issues/1401" data-hovercard-type="pull_request" data-hovercard-url="/biopython/biopython/pull/1401/hovercard" href="https://github.com/biopython/biopython/pull/1401">biopython/biopython#1401</a>.</p>
<p dir="auto">It is not difficult to do in a simple script when we are sure that Numpy or Scipy have not been imported previously with something like:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import os
os.environ[&quot;OMP_NUM_THREADS&quot;] = &quot;1&quot;
import numpy as np"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">os</span>
<span class="pl-s1">os</span>.<span class="pl-s1">environ</span>[<span class="pl-s">"OMP_NUM_THREADS"</span>] <span class="pl-c1">=</span> <span class="pl-s">"1"</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span></pre></div>
<p dir="auto">However, in a library there is a good chance that the user has already imported Numpy in its main script, with something like</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np

import fluidimage"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-k">import</span> <span class="pl-s1">fluidimage</span></pre></div>
<p dir="auto">In this case, I don't see how to set the number of threads used by Numpy from the fluidimage code.</p>
<p dir="auto">Thus, it would be very convenient to have a function <code class="notranslate">np.set_num_threads</code>.</p>