Skip to content

v1.0.3

Compare
Choose a tag to compare
@vineetbansal vineetbansal released this 02 Apr 15:22
· 5 commits to master since this release
97ad92e

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 an osqp.OSQPException. This is a breaking change, but we believe that raising an exception is more explicit and useful than failing silently.
  • The raise_error parameter in <problem>.solve() still defaults to False, but this has the potential of hide problems if the solve failed, so we might change it to True in the future. For now we simply warn the users of this possible change. Users should always check res.info.status or res.info.status_val in any case.
  • The .setup() (and .solve(raise_error=True)) invocations on <solver> would initially have raised ValueErrors. These now raise osqp.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.