scipy/scipy — pull request #3369 by pasky (2014-02-22 00:11:19+00:00)
Title: ENH minimize, minimize_scalar: Add support for user-provided methods

I'm using the excellent scipy.optimize infrastructure for research, experiments and benchmarking of some custom local minimization strategies. However, without this simple change, I have no easy way to plug my minimizer to basinhopping to overload it for global minimization as well; first I added a direct override possibility in PR #3321, but it has been pointed out that a more generic mechanism that could cover other cases would be nicer. A global registry of custom method names has been another idea, implemented in PR #3333 and it has its merits, but it has been deemed that overally a simpler and nicer way is simply passing a callable as the method parameter, instead of a string.

Therefore, this change does just that, checking if method is a callable instead of a string and in that case just going ahead and calling it - both in minimize and minimize_scalar of scipy.optimize. It now also includes examples in the documentation and test suite checks.