v1.0.3
This version introduces two useful enums that can be queried to see the status of several solver operations:
osqp.SolverStatus is useful in the case of <solver>.solve().
osqp.SolverError is useful in the case of <solver>.setup(), <solver>.update_settings() or <solver>.solve().
We also introduce a useful exception class, osqp.OSQPException, that can be "equated" to these enums to find its value:
e == osqp.SolverError.OSQP_NONCVX_ERROR
See the examples folder for usage.
There are a couple of behavior changes that users need to be aware of:
- Initially, if
<solver>.update_settings()failed (due to incorrect values of parameters or otherwise), it would have failed silently. With this version, it will raise anosqp.OSQPException. This is a breaking change, but we believe that raising an exception is more explicit and useful than failing silently. - The
raise_errorparameter in<problem>.solve()still defaults toFalse, but this has the potential of hide problems if the solve failed, so we might change it toTruein the future. For now we simply warn the users of this possible change. Users should always checkres.info.statusorres.info.status_valin any case. - The
.setup()(and.solve(raise_error=True)) invocations on<solver>would initially have raisedValueErrors. These now raiseosqp.OSQPExceptions which are more introspectable.
See Status values and errors for a comprehensive list of status values that you might want to watch out for.