ommx-python-mip-adapter 0.3.4__tar.gz → 0.4.0__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 (15) hide show
  1. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/PKG-INFO +2 -2
  2. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter/adapter.py +5 -9
  3. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter.egg-info/PKG-INFO +2 -2
  4. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter.egg-info/requires.txt +1 -1
  5. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/pyproject.toml +2 -2
  6. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/tests/test_model_to_instance.py +5 -5
  7. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/README.md +0 -0
  8. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter/__init__.py +0 -0
  9. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter/exception.py +0 -0
  10. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter.egg-info/SOURCES.txt +0 -0
  11. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter.egg-info/dependency_links.txt +0 -0
  12. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/ommx_python_mip_adapter.egg-info/top_level.txt +0 -0
  13. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/setup.cfg +0 -0
  14. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/tests/test_instance_to_model.py +0 -0
  15. {ommx_python_mip_adapter-0.3.4 → ommx_python_mip_adapter-0.4.0}/tests/test_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ommx_python_mip_adapter
3
- Version: 0.3.4
3
+ Version: 0.4.0
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-python-mip-adapter
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Requires-Python: >=3.8
17
17
  Description-Content-Type: text/markdown
18
- Requires-Dist: ommx<0.4.0,>=0.3.4
18
+ Requires-Dist: ommx<0.5.0,>=0.4.0
19
19
  Requires-Dist: mip
20
20
  Provides-Extra: dev
21
21
  Requires-Dist: markdown-code-runner; extra == "dev"
@@ -3,7 +3,7 @@ import typing as tp
3
3
  import mip
4
4
 
5
5
  from mip.exceptions import ParameterNotAvailable
6
- from ommx.v1.constraint_pb2 import Constraint, Equality, ConstraintDescription
6
+ from ommx.v1.constraint_pb2 import Constraint, Equality
7
7
  from ommx.v1.function_pb2 import Function
8
8
  from ommx.v1.linear_pb2 import Linear
9
9
  from ommx.v1.solution_pb2 import State
@@ -139,11 +139,7 @@ class OMMXInstanceBuilder:
139
139
 
140
140
  decision_variables.append(
141
141
  DecisionVariable.of_type(
142
- kind,
143
- var.idx,
144
- lower=var.lb,
145
- upper=var.ub,
146
- description=DecisionVariable.Description(name=var.name),
142
+ kind, var.idx, lower=var.lb, upper=var.ub, name=var.name
147
143
  )
148
144
  )
149
145
 
@@ -190,14 +186,14 @@ class OMMXInstanceBuilder:
190
186
  id=id,
191
187
  equality=Equality.EQUALITY_EQUAL_TO_ZERO,
192
188
  function=self._make_function_from_lin_expr(lin_expr),
193
- description=ConstraintDescription(name=name),
189
+ name=name,
194
190
  )
195
191
  elif lin_expr.sense == "<":
196
192
  constraint = Constraint(
197
193
  id=id,
198
194
  equality=Equality.EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO,
199
195
  function=self._make_function_from_lin_expr(lin_expr),
200
- description=ConstraintDescription(name=name),
196
+ name=name,
201
197
  )
202
198
  elif lin_expr.sense == ">":
203
199
  # `ommx.v1.Constraint` does not support `GREATER_THAN_OR_EQUAL_TO_ZERO`.
@@ -206,7 +202,7 @@ class OMMXInstanceBuilder:
206
202
  id=id,
207
203
  equality=Equality.EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO,
208
204
  function=self._make_function_from_lin_expr(-lin_expr),
209
- description=ConstraintDescription(name=name),
205
+ name=name,
210
206
  )
211
207
  else:
212
208
  raise OMMXPythonMIPAdapterError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ommx_python_mip_adapter
3
- Version: 0.3.4
3
+ Version: 0.4.0
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-python-mip-adapter
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Requires-Python: >=3.8
17
17
  Description-Content-Type: text/markdown
18
- Requires-Dist: ommx<0.4.0,>=0.3.4
18
+ Requires-Dist: ommx<0.5.0,>=0.4.0
19
19
  Requires-Dist: mip
20
20
  Provides-Extra: dev
21
21
  Requires-Dist: markdown-code-runner; extra == "dev"
@@ -1,4 +1,4 @@
1
- ommx<0.4.0,>=0.3.4
1
+ ommx<0.5.0,>=0.4.0
2
2
  mip
3
3
 
4
4
  [dev]
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ommx_python_mip_adapter"
7
- version = "0.3.4"
7
+ version = "0.4.0"
8
8
 
9
9
  description = "An adapter for the Python-MIP from/to OMMX."
10
10
  authors = [
@@ -24,7 +24,7 @@ classifiers = [
24
24
  "License :: OSI Approved :: MIT License",
25
25
  ]
26
26
  dependencies = [
27
- "ommx >= 0.3.4, < 0.4.0",
27
+ "ommx >= 0.4.0, < 0.5.0",
28
28
  "mip",
29
29
  ]
30
30
 
@@ -54,19 +54,19 @@ def test_milp():
54
54
  assert decision_variables_x1.kind == DecisionVariable.CONTINUOUS
55
55
  assert decision_variables_x1.bound.lower == CONTINUOUS_LOWER_BOUND
56
56
  assert decision_variables_x1.bound.upper == CONTINUOUS_UPPER_BOUND
57
- assert decision_variables_x1.description.name == "1"
57
+ assert decision_variables_x1.name == "1"
58
58
  decision_variables_x2 = ommx_instance.decision_variables[1]
59
59
  assert decision_variables_x2.id == 1
60
60
  assert decision_variables_x2.kind == DecisionVariable.INTEGER
61
61
  assert decision_variables_x2.bound.lower == INTEGER_LOWER_BOUND
62
62
  assert decision_variables_x2.bound.upper == INTEGER_UPPER_BOUND
63
- assert decision_variables_x2.description.name == "2"
63
+ assert decision_variables_x2.name == "2"
64
64
  decision_variables_x3 = ommx_instance.decision_variables[2]
65
65
  assert decision_variables_x3.id == 2
66
66
  assert decision_variables_x3.kind == DecisionVariable.BINARY
67
67
  assert decision_variables_x3.bound.lower == 0
68
68
  assert decision_variables_x3.bound.upper == 1
69
- assert decision_variables_x3.description.name == "3"
69
+ assert decision_variables_x3.name == "3"
70
70
 
71
71
  # Check the objective function
72
72
  assert ommx_instance.objective.HasField("linear")
@@ -162,13 +162,13 @@ def test_no_objective_model():
162
162
  assert decision_variables_x1.kind == DecisionVariable.CONTINUOUS
163
163
  assert decision_variables_x1.bound.lower == LOWER_BOUND
164
164
  assert decision_variables_x1.bound.upper == UPPER_BOUND
165
- assert decision_variables_x1.description.name == "1"
165
+ assert decision_variables_x1.name == "1"
166
166
  decision_variables_x2 = ommx_instance.decision_variables[1]
167
167
  assert decision_variables_x2.id == 1
168
168
  assert decision_variables_x2.kind == DecisionVariable.CONTINUOUS
169
169
  assert decision_variables_x2.bound.lower == LOWER_BOUND
170
170
  assert decision_variables_x2.bound.upper == UPPER_BOUND
171
- assert decision_variables_x2.description.name == "2"
171
+ assert decision_variables_x2.name == "2"
172
172
 
173
173
  # check the objective function
174
174
  assert ommx_instance.objective.HasField("constant")