OpenSolve#
- class OpenSolve#
Context manager for a manually executed Solve inside a Run.
OpenSolveis returned byRun.open_solve(...). Usesolver_inputto access the backend solver model, run backend-specific APIs, decode the solver output, and record adapter options that are set directly on the backend model. The Solve entry is finalized when the context exits.- __exit__(exc_type: Optional[Any] = None, exc_value: Optional[Any] = None, traceback: Optional[Any] = None) bool#
- __repr__() str#
- decode(data: Any) Solution#
Decode backend solver output through the adapter.
The decoded Solution is kept as this scope's finished output candidate. The Solve entry is recorded when the
OpenSolvecontext exits, so diagnostics and annotations can still be recorded after this call and before the end of thewithblock.
- log_adapter_option(name: str, value: Any) None#
Record an adapter option set through direct backend model access.
- property diagnostics: Optional[DiagnosticCollector]#
Read-only property.
Diagnostics collector stored with this Solve, or
Nonewhen disabled.
- property solve_id: int#
Read-only property.
Reserved Solve ID for this manual Solve.
- property terminal_state: Optional[dict[str, Any]]#
Read-only property.
Terminal state recorded when this manual Solve scope closes.
Returns
Noneuntil the context has closed. After closing, this exposes the recorded Solve outcome together with trace and diagnostics finalization states for advanced debugging.