ommx-python-mip-adapter 3.0.0a4__tar.gz → 3.0.0a7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/PKG-INFO +2 -2
  2. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter/adapter.py +11 -5
  3. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter.egg-info/PKG-INFO +2 -2
  4. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter.egg-info/requires.txt +1 -1
  5. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/pyproject.toml +2 -2
  6. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/tests/test_tracing.py +4 -3
  7. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/README.md +0 -0
  8. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter/__init__.py +0 -0
  9. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter/exception.py +0 -0
  10. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter/python_mip_to_ommx.py +0 -0
  11. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter.egg-info/SOURCES.txt +0 -0
  12. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter.egg-info/dependency_links.txt +0 -0
  13. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/ommx_python_mip_adapter.egg-info/top_level.txt +0 -0
  14. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/setup.cfg +0 -0
  15. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/tests/test_adapter.py +0 -0
  16. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/tests/test_constant_constraint.py +0 -0
  17. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/tests/test_integration.py +0 -0
  18. {ommx_python_mip_adapter-3.0.0a4 → ommx_python_mip_adapter-3.0.0a7}/tests/test_model_to_instance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommx_python_mip_adapter
3
- Version: 3.0.0a4
3
+ Version: 3.0.0a7
4
4
  Summary: An adapter for the Python-MIP from/to OMMX.
5
5
  Author-email: "Jij Inc." <info@j-ij.com>
6
6
  Project-URL: Repository, https://github.com/Jij-Inc/ommx
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
- Requires-Dist: ommx<4.0.0,>=3.0.0a4
18
+ Requires-Dist: ommx<4.0.0,>=3.0.0a7
19
19
  Requires-Dist: mip<2.0.0,>=1.17.0
20
20
  Requires-Dist: cffi<2.0.0,>=1.15.0
21
21
 
@@ -6,6 +6,7 @@ import mip
6
6
  from opentelemetry import trace
7
7
 
8
8
  from ommx.adapter import (
9
+ DiagnosticsSink,
9
10
  SolverAdapter,
10
11
  InfeasibleDetected,
11
12
  UnboundedDetected,
@@ -72,6 +73,8 @@ class OMMXPythonMIPAdapter(SolverAdapter):
72
73
  ommx_instance: Instance,
73
74
  relax: bool = False,
74
75
  verbose: bool = False,
76
+ *,
77
+ diagnostics: DiagnosticsSink | None = None,
75
78
  ) -> Solution:
76
79
  """
77
80
  Solve the given ommx.v1.Instance using Python-MIP, returning an ommx.v1.Solution.
@@ -181,11 +184,14 @@ class OMMXPythonMIPAdapter(SolverAdapter):
181
184
  1.0
182
185
 
183
186
  """
184
- adapter = cls(ommx_instance, relax=relax, verbose=verbose)
185
- model = adapter.solver_input
186
- with _tracer.start_as_current_span("solve"):
187
- model.optimize(relax=relax)
188
- return adapter.decode(model)
187
+ _ = diagnostics
188
+ with _tracer.start_as_current_span("solve") as span:
189
+ span.set_attribute("adapter", f"{cls.__module__}.{cls.__qualname__}")
190
+ adapter = cls(ommx_instance, relax=relax, verbose=verbose)
191
+ model = adapter.solver_input
192
+ with _tracer.start_as_current_span("call"):
193
+ model.optimize(relax=relax)
194
+ return adapter.decode(model)
189
195
 
190
196
  @property
191
197
  def solver_input(self) -> mip.Model:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommx_python_mip_adapter
3
- Version: 3.0.0a4
3
+ Version: 3.0.0a7
4
4
  Summary: An adapter for the Python-MIP from/to OMMX.
5
5
  Author-email: "Jij Inc." <info@j-ij.com>
6
6
  Project-URL: Repository, https://github.com/Jij-Inc/ommx
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
- Requires-Dist: ommx<4.0.0,>=3.0.0a4
18
+ Requires-Dist: ommx<4.0.0,>=3.0.0a7
19
19
  Requires-Dist: mip<2.0.0,>=1.17.0
20
20
  Requires-Dist: cffi<2.0.0,>=1.15.0
21
21
 
@@ -1,3 +1,3 @@
1
- ommx<4.0.0,>=3.0.0a4
1
+ ommx<4.0.0,>=3.0.0a7
2
2
  mip<2.0.0,>=1.17.0
3
3
  cffi<2.0.0,>=1.15.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ommx_python_mip_adapter"
7
- version = "3.0.0a4"
7
+ version = "3.0.0a7"
8
8
 
9
9
  description = "An adapter for the Python-MIP from/to OMMX."
10
10
  authors = [{ name = "Jij Inc.", email = "info@j-ij.com" }]
@@ -23,7 +23,7 @@ classifiers = [
23
23
  ]
24
24
 
25
25
  dependencies = [
26
- "ommx >= 3.0.0a4, < 4.0.0",
26
+ "ommx >= 3.0.0a7, < 4.0.0",
27
27
  "mip >= 1.17.0, < 2.0.0",
28
28
  "cffi >= 1.15.0, < 2.0.0",
29
29
  ]
@@ -16,9 +16,10 @@ def test_solve_emits_convert_solve_decode_spans():
16
16
  with capture_trace() as result:
17
17
  OMMXPythonMIPAdapter.solve(instance)
18
18
 
19
- names = [s.name for s in result.spans]
20
- assert "convert" in names
19
+ names = [span.name for span in result.spans]
21
20
  assert "solve" in names
21
+ assert "convert" in names
22
+ assert "call" in names
22
23
  assert "decode" in names
23
24
 
24
25
 
@@ -37,6 +38,6 @@ def test_manual_flow_emits_convert_and_decode_spans():
37
38
  model.optimize()
38
39
  adapter.decode(model)
39
40
 
40
- names = [s.name for s in result.spans]
41
+ names = [span.name for span in result.spans]
41
42
  assert "convert" in names
42
43
  assert "decode" in names