OpenSolve

OpenSolve#

class OpenSolve#

Context manager for a manually executed Solve inside a Run.

OpenSolve is returned by Run.open_solve(...). Use solver_input to 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.

__enter__() OpenSolve#
__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 OpenSolve context exits, so diagnostics and annotations can still be recorded after this call and before the end of the with block.

log_adapter_option(name: str, value: Any) None#

Record an adapter option set through direct backend model access.

property adapter: Any#

Read-only property.

Adapter instance used by this manual Solve.

property diagnostics: Optional[DiagnosticCollector]#

Read-only property.

Diagnostics collector stored with this Solve, or None when disabled.

property solve_id: int#

Read-only property.

Reserved Solve ID for this manual Solve.

property solver_input: Any#

Read-only property.

Backend solver model generated by the adapter.

property terminal_state: Optional[dict[str, Any]]#

Read-only property.

Terminal state recorded when this manual Solve scope closes.

Returns None until the context has closed. After closing, this exposes the recorded Solve outcome together with trace and diagnostics finalization states for advanced debugging.