OMMX adapter for Python-MIP
This package provides an adapter for the Python-MIP from/to OMMX
Python-MIP as a solver in OMMX toolchain
sequenceDiagram
participant U as User
participant A as Adapter
participant P as Python-MIP
U->>A: ommx.v1.Instance
A->>U: Python-MIP model
U->>P: Python-MIP model and Parameters for Python-MIP;
P->>P: Solve with CBC, Gurobi, or other solvers
P->>U: Optimized model
U->>A: Optimized model and ommx.v1.Instance
A->>U: ommx.v1.Solution
Python-MIP as a user interface to create OMMX instance
sequenceDiagram
participant U as User
participant A as Adapter
participant O as Other OMMX toolchain
U->>A: Python-MIP model
A->>U: ommx.v1.Instance
U->>O: ommx.v1.Instance and Parameters for other solver
O->>O: Solve the instance with other solver using other adapter
O->>U: ommx.v1.Solution
Usage
ommx-python-mip-adapter can be installed from PyPI as follows:
pip install ommx-python-mip-adapter
Python-MIP can be used through ommx-python-mip-adapter by using the following:
from ommx_python_mip_adapter import OMMXPythonMIPAdapter
from ommx.v1 import Instance, DecisionVariable
x1 = DecisionVariable.integer(1, lower=0, upper=5)
ommx_instance = Instance.from_components(
decision_variables=[x1],
objective=x1,
constraints=[],
sense=Instance.MINIMIZE,
)
# Create `ommx.v1.Solution` from the `mip.Model`
ommx_solution = OMMXPythonMIPAdapter.solve(ommx_instance)
print(ommx_solution)
You can get ommx.v1.Instance from a Python-MIP model as the following:
import mip
import ommx_python_mip_adapter as adapter
model = mip.Model()
x1=model.add_var(name="1", var_type=mip.INTEGER, lb=0, ub=5)
x2=model.add_var(name="2", var_type=mip.CONTINUOUS, lb=0, ub=5)
model.objective = - x1 - 2 * x2
model.add_constr(x1 + x2 - 6 <= 0)
ommx_instance = adapter.model_to_instance(model)
print(ommx_instance)
Reference
Release files for ommx-python-mip-adapter 2.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ommx_python_mip_adapter-2.7.0.tar.gz | 10.9 kB | Details |
Release files / ommx_python_mip_adapter-2.7.0.tar.gz
| Download URL | ommx_python_mip_adapter-2.7.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a40fdc22760ce9fe9085cde71e8f84197a1f0aeba56afbbc18f424e372fd5c07
|
|
BLAKE2b-256 checksum How to use checksums |
9bf16567a8ac90e78a989cea5ac43237fd5f74b38648bc3b3c2cc8797c6067dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency log