pyoframe 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
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.
- pyoframe/model.py +15 -12
- {pyoframe-0.1.3.dist-info → pyoframe-0.1.4.dist-info}/METADATA +1 -1
- {pyoframe-0.1.3.dist-info → pyoframe-0.1.4.dist-info}/RECORD +6 -6
- {pyoframe-0.1.3.dist-info → pyoframe-0.1.4.dist-info}/LICENSE +0 -0
- {pyoframe-0.1.3.dist-info → pyoframe-0.1.4.dist-info}/WHEEL +0 -0
- {pyoframe-0.1.3.dist-info → pyoframe-0.1.4.dist-info}/top_level.txt +0 -0
pyoframe/model.py
CHANGED
|
@@ -329,33 +329,36 @@ class Model:
|
|
|
329
329
|
"""
|
|
330
330
|
self.poi.computeIIS()
|
|
331
331
|
|
|
332
|
+
@for_solvers("gurobi")
|
|
332
333
|
def dispose(self):
|
|
333
334
|
"""
|
|
334
335
|
Tries to close the solver connection by deleting the model and forcing the garbage collector to run.
|
|
335
336
|
|
|
336
|
-
Once this method is called, this model is no longer usable.
|
|
337
|
+
Gurobi only. Once this method is called, this model is no longer usable.
|
|
337
338
|
|
|
338
|
-
This method will not work if you
|
|
339
|
+
This method will not work if you have a variable that references self.poi.
|
|
339
340
|
Unfortunately, this is a limitation from the underlying solver interface library.
|
|
340
341
|
See https://github.com/metab0t/PyOptInterface/issues/36 for context.
|
|
341
342
|
|
|
342
343
|
Examples:
|
|
343
|
-
>>> m = pf.Model()
|
|
344
|
-
>>> m.X = pf.Variable()
|
|
344
|
+
>>> m = pf.Model(solver="gurobi")
|
|
345
|
+
>>> m.X = pf.Variable(ub=1)
|
|
346
|
+
>>> m.maximize = m.X
|
|
347
|
+
>>> m.optimize()
|
|
348
|
+
>>> m.X.solution
|
|
349
|
+
1.0
|
|
345
350
|
>>> m.dispose()
|
|
346
|
-
>>> m.X
|
|
351
|
+
>>> m.X.solution
|
|
347
352
|
Traceback (most recent call last):
|
|
348
353
|
...
|
|
349
|
-
AttributeError: 'Model' object has no attribute '
|
|
354
|
+
AttributeError: 'Model' object has no attribute 'poi'
|
|
350
355
|
"""
|
|
351
356
|
import gc
|
|
352
357
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
except AttributeError:
|
|
358
|
-
pass
|
|
358
|
+
env = self.poi._env
|
|
359
|
+
del self.poi
|
|
360
|
+
gc.collect()
|
|
361
|
+
del env
|
|
359
362
|
gc.collect()
|
|
360
363
|
|
|
361
364
|
def _set_param(self, name, value):
|
|
@@ -2,13 +2,13 @@ pyoframe/__init__.py,sha256=nEN0OgqhevtsvxEiPbJLzwPojf3ngYAoT90M_1mc4kM,477
|
|
|
2
2
|
pyoframe/_arithmetic.py,sha256=vqzMZip1kTkUUMyHohUyKJxx2nEeQIH7N57fwevLWaQ,17284
|
|
3
3
|
pyoframe/constants.py,sha256=Dy1sCzykZlmkbvgsc5ckujqXPuYmsKkD3stANU0qr5Y,3784
|
|
4
4
|
pyoframe/core.py,sha256=4heBn7RGOWV-Yg0OoiLr8sGBaygpTx-D-pLuC4nC0Dw,62865
|
|
5
|
-
pyoframe/model.py,sha256=
|
|
5
|
+
pyoframe/model.py,sha256=7nVH2oZeTuk53l76PLNElsiHEgmbTvrf7lGIa9_CYm4,13011
|
|
6
6
|
pyoframe/model_element.py,sha256=RBmsE2FOct3UL2N2LZLfWYv2wL_QKqNmKmmR_pD_ERs,5945
|
|
7
7
|
pyoframe/monkey_patch.py,sha256=9IfS14G6IPabmM9z80jzi_D4Rq0Mdx5aUCA39Yi2tgE,2044
|
|
8
8
|
pyoframe/objective.py,sha256=PBWxj30QkFlsvY6ijZ6KjyKdrJARD4to0ieF6GUqaQU,3238
|
|
9
9
|
pyoframe/util.py,sha256=Oyk8xh6FJHlb04X_cM4lN0UzdnKLXAMrKfyOf7IexiA,13480
|
|
10
|
-
pyoframe-0.1.
|
|
11
|
-
pyoframe-0.1.
|
|
12
|
-
pyoframe-0.1.
|
|
13
|
-
pyoframe-0.1.
|
|
14
|
-
pyoframe-0.1.
|
|
10
|
+
pyoframe-0.1.4.dist-info/LICENSE,sha256=dkwA40ZzT-3x6eu2a6mf_o7PNSqHbdsyaFNhLxGHNQs,1065
|
|
11
|
+
pyoframe-0.1.4.dist-info/METADATA,sha256=v3ZH_JvXSg4cN515Qo0FvZviXIC0l-Ja5tgq5IdgwLI,3558
|
|
12
|
+
pyoframe-0.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
13
|
+
pyoframe-0.1.4.dist-info/top_level.txt,sha256=10z3OOJSVLriQ0IrFLMH8CH9zByugPWolqhlHlkNjV4,9
|
|
14
|
+
pyoframe-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|