[SciPy-Dev] PR #196: simplification of optimization wrappers

Pauli Virtanen pav@iki...
Wed Apr 18 15:38:19 CDT 2012


18.04.2012 22:26, Denis Laxalde kirjoitti:
> In pull request #196, I am proposing to simplify the signature of
> optimization wrappers (minimize, minimize_scalar, etc.) to get
> something like:
>   x, info = minimize(fun, x0, [jac, constraints], options)

How about going even further, and not even returning `x`. Rather, stuff
it inside `info`:

    sol = minimize(fun, x0, [jac, constraints], options)
    x = sol.x

Just change the solution object to a dict subclass with attribute
accessors, and you're done.

And maybe even add `def __array__(self): return self.x`, so you can do


More information about the SciPy-Dev mailing list