title: Silencing numba warning
body: <p>I have a numba decorated function which is called by another class method. It keeps giving me deprecation warnings. To silence it I've so far tried:</p>
  <p>(1) adding <code>@jit(warn=False)</code>, but throws an error that the option is unavailable</p>
  <p>(2) trying to catch the warning with warning.catch_warnings()</p>
  <p>None seems to work, interestingly enough, if I break before the execution of the function and run in the debug console the same statement (<code>with warnings.catch_warnings()</code> etc.) and then run the method, it will silence it, but if I run the .py fully it doesn't silence it. Any ideas?</p>
  <pre><code>@jit
  def annualize(data, freq=12, type='log'):
  
      T = data.shape[1]
      N = data.shape[0]
      rets = np.zeros([N,T-freq])
      for t in range(freq, T):
          valid = (data[:, t-freq] != 0.0) * (data[:, t] != 0.0)
          data0 = data[:, t-freq] * valid
          data1 = data[:, t] * valid
          if type == 'log':
              rets[:, t-freq] = np.log(data1) - np.log(data0)
          elif type == 'perc':
              rets[:, t-freq] = data1 / data0 - 1
  
      rets[np.where(np.isnan(rets))] = 0
      return rets
  
  [... other code and classes ...]
  
   class MyClass:
  
     def __init__(self, args): 
         self.args = args
   
     def set_returns(self, freq = 'annual'):
         with warnings.catch_warnings():
              warnings.simplefilter('ignore', category=NumbaDeprecationWarning)
              warnings.simplefilter('ignore', category=NumbaPendingDeprecationWarning)
              if freq == 'annual':
                  self.r = annualize(self.total_return.values, type='perc')
                  self.log_r = annualize(self.total_return.values, type='log')
              elif freq == 'monthly':
                  self.r = annualize(self.total_return.values, freq=1, type='perc')
                  self.log_r = annualize(self.total_return.values, freq=1, type='log')
  
  </code></pre>