pyoframe 0.1.3__tar.gz → 0.1.4__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 (25) hide show
  1. {pyoframe-0.1.3/src/pyoframe.egg-info → pyoframe-0.1.4}/PKG-INFO +1 -1
  2. {pyoframe-0.1.3 → pyoframe-0.1.4}/pyproject.toml +1 -1
  3. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/model.py +15 -12
  4. {pyoframe-0.1.3 → pyoframe-0.1.4/src/pyoframe.egg-info}/PKG-INFO +1 -1
  5. {pyoframe-0.1.3 → pyoframe-0.1.4}/LICENSE +0 -0
  6. {pyoframe-0.1.3 → pyoframe-0.1.4}/README.md +0 -0
  7. {pyoframe-0.1.3 → pyoframe-0.1.4}/setup.cfg +0 -0
  8. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/__init__.py +0 -0
  9. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/_arithmetic.py +0 -0
  10. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/constants.py +0 -0
  11. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/core.py +0 -0
  12. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/model_element.py +0 -0
  13. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/monkey_patch.py +0 -0
  14. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/objective.py +0 -0
  15. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe/util.py +0 -0
  16. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe.egg-info/SOURCES.txt +0 -0
  17. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe.egg-info/dependency_links.txt +0 -0
  18. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe.egg-info/requires.txt +0 -0
  19. {pyoframe-0.1.3 → pyoframe-0.1.4}/src/pyoframe.egg-info/top_level.txt +0 -0
  20. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_arithmetic.py +0 -0
  21. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_examples.py +0 -0
  22. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_io.py +0 -0
  23. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_model.py +0 -0
  24. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_operations.py +0 -0
  25. {pyoframe-0.1.3 → pyoframe-0.1.4}/tests/test_solver.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyoframe
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Blazing fast linear program interface
5
5
  Author-email: Bravos Power <dev@bravospower.com>
6
6
  Project-URL: Homepage, https://bravos-power.github.io/pyoframe/
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyoframe"
7
- version = "0.1.3"
7
+ version = "0.1.4"
8
8
  authors = [{ name = "Bravos Power", email = "dev@bravospower.com" }]
9
9
  description = "Blazing fast linear program interface"
10
10
  readme = "README.md"
@@ -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 still have variables that reference parts of this model.
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 'X'
354
+ AttributeError: 'Model' object has no attribute 'poi'
350
355
  """
351
356
  import gc
352
357
 
353
- for attr in dir(self):
354
- if not attr.startswith("__"):
355
- try:
356
- delattr(self, attr)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyoframe
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Blazing fast linear program interface
5
5
  Author-email: Bravos Power <dev@bravospower.com>
6
6
  Project-URL: Homepage, https://bravos-power.github.io/pyoframe/
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes