Assertion during problem update triggered by previous exception in solution search.
As a side-effect of #328 (closed) (here triggered by accidentally trying to optimize a constant), changing the objective and re-solving fails an assertion (for a different reason than what is claimed):
File picos/solvers/solver.py:585, in Solver._objective_has_changed(self)
579 def _objective_has_changed(self):
580 """Check for an objective function change.
581
582 :returns: Whether the optimization objective has changed since the last
583 forward or update.
584 """
--> 585 assert self._knownObjective is not None, \
586 "_objective_has_changed may only be used inside _update_problem."
588 objectiveChanged = self._knownObjective != self.ext.objective
590 if objectiveChanged:
AssertionError: _objective_has_changed may only be used inside _update_problem.
This is a niche problem since it requires an earlier error to leave a bad state but we should try to make this scenario more robust by resetting the solver instance when necessary.