pyoframe 0.0.6__tar.gz → 0.0.7__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 (28) hide show
  1. {pyoframe-0.0.6/src/pyoframe.egg-info → pyoframe-0.0.7}/PKG-INFO +1 -1
  2. {pyoframe-0.0.6 → pyoframe-0.0.7}/pyproject.toml +1 -1
  3. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/core.py +7 -3
  4. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/solvers.py +1 -1
  5. {pyoframe-0.0.6 → pyoframe-0.0.7/src/pyoframe.egg-info}/PKG-INFO +1 -1
  6. {pyoframe-0.0.6 → pyoframe-0.0.7}/tests/test_solver.py +1 -1
  7. {pyoframe-0.0.6 → pyoframe-0.0.7}/LICENSE +0 -0
  8. {pyoframe-0.0.6 → pyoframe-0.0.7}/README.md +0 -0
  9. {pyoframe-0.0.6 → pyoframe-0.0.7}/setup.cfg +0 -0
  10. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/__init__.py +0 -0
  11. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/_arithmetic.py +0 -0
  12. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/constants.py +0 -0
  13. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/io.py +0 -0
  14. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/io_mappers.py +0 -0
  15. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/model.py +0 -0
  16. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/model_element.py +0 -0
  17. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/monkey_patch.py +0 -0
  18. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/objective.py +0 -0
  19. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/user_defined.py +0 -0
  20. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe/util.py +0 -0
  21. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe.egg-info/SOURCES.txt +0 -0
  22. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe.egg-info/dependency_links.txt +0 -0
  23. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe.egg-info/requires.txt +0 -0
  24. {pyoframe-0.0.6 → pyoframe-0.0.7}/src/pyoframe.egg-info/top_level.txt +0 -0
  25. {pyoframe-0.0.6 → pyoframe-0.0.7}/tests/test_arithmetic.py +0 -0
  26. {pyoframe-0.0.6 → pyoframe-0.0.7}/tests/test_examples.py +0 -0
  27. {pyoframe-0.0.6 → pyoframe-0.0.7}/tests/test_io.py +0 -0
  28. {pyoframe-0.0.6 → pyoframe-0.0.7}/tests/test_operations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyoframe
3
- Version: 0.0.6
3
+ Version: 0.0.7
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.0.6"
7
+ version = "0.0.7"
8
8
  authors = [{ name = "Bravos Power", email = "dev@bravospower.com" }]
9
9
  description = "Blazing fast linear program interface"
10
10
  readme = "README.md"
@@ -271,7 +271,11 @@ class Set(ModelElement, SupportsMath, SupportPolarsMethodMixin):
271
271
  elif isinstance(set, Constraint):
272
272
  df = set.data.select(set.dimensions_unsafe)
273
273
  elif isinstance(set, SupportsMath):
274
- df = set.to_expr().data.drop(RESERVED_COL_KEYS).unique(maintain_order=True)
274
+ df = (
275
+ set.to_expr()
276
+ .data.drop(RESERVED_COL_KEYS, strict=False)
277
+ .unique(maintain_order=True)
278
+ )
275
279
  elif isinstance(set, pd.Index):
276
280
  df = pl.from_pandas(pd.DataFrame(index=set).reset_index())
277
281
  elif isinstance(set, pd.DataFrame):
@@ -1259,7 +1263,7 @@ class Variable(ModelElementWithId, SupportsMath, SupportPolarsMethodMixin):
1259
1263
  )
1260
1264
 
1261
1265
  def to_expr(self) -> Expression:
1262
- return self._new(self.data.drop(SOLUTION_KEY))
1266
+ return self._new(self.data.drop(SOLUTION_KEY, strict=False))
1263
1267
 
1264
1268
  def _new(self, data: pl.DataFrame):
1265
1269
  e = Expression(data.with_columns(pl.lit(1.0).alias(COEF_KEY)))
@@ -1337,5 +1341,5 @@ class Variable(ModelElementWithId, SupportsMath, SupportPolarsMethodMixin):
1337
1341
  data = expr.data.rename({dim: "__prev"})
1338
1342
  data = data.join(
1339
1343
  wrapped, left_on="__prev", right_on="__next", how="inner"
1340
- ).drop(["__prev", "__next"])
1344
+ ).drop(["__prev", "__next"], strict=False)
1341
1345
  return expr._new(data)
@@ -313,7 +313,7 @@ class GurobiSolver(FileBasedSolver):
313
313
  termination_condition = GurobiSolver.CONDITION_MAP.get(condition, condition)
314
314
  status = Status.from_termination_condition(termination_condition)
315
315
 
316
- if status.is_ok:
316
+ if status.is_ok and (termination_condition == "optimal"):
317
317
  if solution_file:
318
318
  m.write(_path_to_str(solution_file))
319
319
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyoframe
3
- Version: 0.0.6
3
+ Version: 0.0.7
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/
@@ -92,7 +92,7 @@ def test_support_variable_attributes():
92
92
  )
93
93
  assert_frame_equal(
94
94
  m.X.RC,
95
- pl.DataFrame({"t": [1, 2], "RC": [0, 1.9]}),
95
+ pl.DataFrame({"t": [1, 2], "RC": [0.0, 1.9]}),
96
96
  check_dtype=False,
97
97
  check_row_order=False,
98
98
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes