title: Scipy curvefit RuntimeError:Optimal parameters not found. Test and avoid error message
body: <p>Occasionally when I want to fit a probability distribution to actual data I get the message "Scipy curve_fit Runtime Error:Optimal parameters not found: Number of calls to function has reached maxfev = 1000". The program halts and I get an error message. Is there a way to capture this status before the program halts? If I can read that maxfev number of iterations have occurred I want the program to try a simpler function to fit, a function although not the best choice but will work for sure. Can anyone give me advice on this?</p>