Result¶
The result contract shared by every ortidy solver.
Every solver returns a SolveResult carrying the user’s frame (with
assignment columns added) plus a structured status, objective value, and solve
metadata. This replaces the old print("no optimal solution"); return None
pattern. A FEASIBLE solution is a success, not a failure.
- class ortidy.result.SolveStatus(*values)[source]¶
-
Backend-neutral solve status.
The string values are stable and safe to compare against / serialize.
- ortidy.result.from_cp_sat(status)[source]¶
Map a CP-SAT solve status to
SolveStatus.Accepts
Anybecause the status type is anintin older OR-Tools and aCpSolverStatusenum in newer ones — this is a thin cross-version adapter.- Parameters:
status (Any)
- Return type:
- ortidy.result.from_mip(status)[source]¶
Map a
pywraplplinear-solver status code toSolveStatus.- Parameters:
status (int)
- Return type:
- class ortidy.result.SolveResult(frame, status, objective=None, metadata=<factory>)[source]¶
Bases:
objectStructured solver output.
- frame¶
The result dataframe in the same backend the user passed in (pandas in → pandas out, Polars in → Polars out).
Nonewhen no solution frame could be produced (e.g. infeasible models).- Type:
Any
- status¶
A
SolveStatusenum member.
- metadata¶
Solve metadata —
wall_time(seconds),gap, solver name, and any solver-specific extras.