OMMX Python SDK 2.3.x#

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

See the GitHub Releases above for full details. The following summarizes the main changes.

New Features#

Pyodide (WebAssembly) support (2.3.0, #679)#

OMMX can now run in the browser via Pyodide. However, network-dependent features (OCI artifact push/pull) are not available. Starting from 2.3.6, Pyodide builds are provided in GitHub Releases.

Constraint violation calculation (2.3.0, #680)#

New methods for quantifying constraint violations in solutions:

  • EvaluatedConstraint.violation — returns the violation amount for a single constraint (0 if feasible).

  • Solution.total_violation_l1() — sum of all constraint violations (L1 norm).

  • Solution.total_violation_l2() — root sum of squares of all constraint violations (L2 norm).

Useful for analyzing infeasible solutions and implementing penalty-based methods.

NoSolutionObtained exception (2.3.1, #688)#

A new ommx.adapter.NoSolutionObtained exception distinguishes the case where a solver times out without finding any feasible solution from InfeasibleDetected or UnboundedDetected. The PySCIPOpt and Python-MIP adapters have been updated to raise the appropriate exception type.

Logical Memory Profiler (2.3.1, #683)#

A logical memory profiling system that outputs flamegraph-compatible folded-stack format. Accessible from Python via instance.logical_memory_profile(). Useful for understanding the memory footprint of large-scale instances.

log_encode scoped to used_decision_variables (2.3.3, #696)#

log_encode now creates variables only for decision variables actually referenced in the objective or constraints. This avoids duplicate variable creation on repeated calls and reduces overhead for instances with many unused variables.

Bug Fixes#

Function().terms with non-zero constants (2.3.5, #714)#

Function.terms was returning a raw float instead of a proper dict entry when the function had a non-zero constant term.