title: Pause or stop numpy calculation after RuntimeWarning occured
body: <p>I am doing some calculations using <a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.optimize.fsolve.html" rel="nofollow"><code>numpy.optimize.fsolve</code></a>. Due to inproper initial values some of those calculations lead to a RuntimeWarning telling</p>
  
  <blockquote>
    <p>RuntimeWarning: The iteration is not making good progress, as measured
    by the    improvement from the last ten iterations.<br>
    warnings.warn(msg, RuntimeWarning)</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>RuntimeWarning: The iteration is not making good progress, as measured
    by the improvement from the last five Jacobian evaluations.<br>
    warnings.warn(msg, RuntimeWarning)</p>
  </blockquote>
  
  <p>Since I am writing all initial values and the belonging results into a text-file (just piping stdout to a file), I want to get a clue in which calculation of my somewhat 500 steps the above mentioned RuntimeWarnings occured.</p>
  
  <p>As mentioned in the <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.seterr.html" rel="nofollow">numpy docs</a> the warnings are handled by <a href="https://docs.python.org/3.5/library/warnings.html" rel="nofollow">Python's standard warnings module</a>, but is there a way to stop or pause calculations after the first RuntimeWarning occured?</p>