title: Numba jit warnings interpretation in python
body: <p>I have defined the following recursive array generator and am using Numba jit to try and accelerate the processing (based on <a href="https://stackoverflow.com/questions/4407984/is-it-possible-to-vectorize-recursive-calculation-of-a-numpy-array-where-each-el">this SO answer</a>)</p>
  
  <pre class="lang-py prettyprint-override"><code>@jit("float32[:](float32,float32,intp)", nopython=False, nogil=True)
  def calc_func(a, b, n):
      res = np.empty(n, dtype="float32")
      res[0] = 0
      for i in range(1, n):
          res[i] = a * res[i - 1] + (1 - a) * (b ** (i - 1))
      return res
  a = calc_func(0.988, 0.9988, 5000)
  </code></pre>
  
  <p>I am getting a bunch of warnings/errors that I do not quite get. Would appreciate help in explaining them and making them disappear in order to (I'm assuming) speed up the calculation even more.</p>
  
  <p>Here they are below :</p>
  
  <blockquote>
    <p>NumbaWarning: 
    Compilation is falling back to object mode WITH looplifting enabled because Function "calc_func" failed type inference due to: Invalid use of Function() with argument(s) of type(s): (int64, dtype=Literalstr)
     * parameterized</p>
    
    <p>In definition 0:
        All templates rejected with literals.</p>
    
    <p>In definition 1:
        All templates rejected without literals.
    This error is usually caused by passing an argument of a type that is unsupported by the named function.</p>
    
    <p>[1] During: resolving callee type: Function()</p>
    
    <p>[2] During: typing of call at <code>res = np.empty(n, dtype="float32")</code></p>
    
    <p>File "thenameofmyscript.py", line 71:</p>
  </blockquote>
  
  <pre class="lang-py prettyprint-override"><code>def calc_func(a, b, n):
      res = np.empty(n, dtype="float32")
      ^
  </code></pre>
  
  <blockquote>
    <p>@jit("float32:", nopython=False, nogil=True)</p>
    
    <p>thenameofmyscript.py:69: NumbaWarning: 
    Compilation is falling back to object mode WITHOUT looplifting enabled because Function "calc_func" failed type inference due to: cannot determine Numba type of <code>&lt;class 'numba.dispatcher.LiftedLoop'&gt;</code></p>
    
    <p>File "thenameofmyscript.py", line 73:</p>
  </blockquote>
  
  <pre class="lang-py prettyprint-override"><code>def calc_func(a, b, n):
          &lt;source elided&gt;
          res[0] = 0
          for i in range(1, n):
          ^
  </code></pre>
  
  <blockquote>
    <p>@jit("float32:", nopython=False, nogil=True)</p>
    
    <p>H:\projects\decay-optimizer\venv\lib\site-packages\numba\compiler.py:742: NumbaWarning: Function "calc_func" was compiled in object mode without forceobj=True, but has lifted loops.</p>
    
    <p>File "thenameofmyscript.py", line 70:</p>
  </blockquote>
  
  <pre class="lang-py prettyprint-override"><code>@jit("float32[:](float32,float32,intp)", nopython=False, nogil=True)
      def calc_func(a, b, n):
      ^
  </code></pre>
  
  <blockquote>
    <p>self.func_ir.loc))</p>
    
    <p>H:\projects\decay-optimizer\venv\lib\site-packages\numba\compiler.py:751: NumbaDeprecationWarning: 
    Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.</p>
    
    <p>File "thenameofmyscript.py", line 70:</p>
  </blockquote>
  
  <pre class="lang-py prettyprint-override"><code>@jit("float32[:](float32,float32,intp)", nopython=False, nogil=True)
      def calc_func(a, b, n):
      ^
  </code></pre>
  
  <blockquote>
    <p>warnings.warn(errors.NumbaDeprecationWarning(msg, self.func_ir.loc))</p>
    
    <p>thenameofmyscript.py:69: NumbaWarning: Code running in object mode won't allow parallel execution despite nogil=True.
      @jit("float32:", nopython=False, nogil=True)</p>
  </blockquote>