Wilhoit.fit_to_data might return a bad fit silently #1771
Labels
abandoned
abandoned issue/PR as determined by actions bot
Complexity: Low
Good First Issue
stale
stale issue/PR as determined by actions bot
Type: Risk of Error
Bug Description
Sometimes, warning messages like the ones below are printed during a call to Wilhoit.fit_to_data
The lines of code in question are here:
RMG-Py/rmgpy/thermo/wilhoit.pyx
Lines 217 to 240 in 447ff5e
As far as I can tell, we don't do any checking here to see if the fit is bad, so unless scipy.optimize.fminbound throws an error (which it doesn't appear to do) this will fail silently. However, fminbound does return a flag that tells you whether the optimization converged or not. It might be worthwhile to use this information (if nothing else print a warning for the specific species, but maybe try re-fitting using another method. I could see why we wouldn't want this to stop an RMG job in its tracks).
How To Reproduce
Run the generate_reactions IPython notebook (once #1735 is merged in or do it on this branch) and you will see the error messages. I will need to do some digging to see which species is causing the issue specifically.
Expected Behavior
If we obtain a bad fit, we should do something about it, and at a minimum, warn the user for the specific species. It is possible that we handle this properly and I am simply missing some code that does this error handling, but it is worth double checking.
The text was updated successfully, but these errors were encountered: