Skip to content

Commit 1e5a4ec

Browse files
handle missing dual values when barrier solution has no crossover (#601)
* handle missing dual values when barrier solution has no crossover * Add release notes --------- Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
1 parent ef9a9e4 commit 1e5a4ec

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

doc/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Upcoming Version
1717
* Add ``active`` parameter to ``piecewise()`` for gating piecewise linear functions with a binary variable (e.g. unit commitment). Supported for incremental, SOS2, and disjunctive methods.
1818
* Add the `sphinx-copybutton` to the documentation
1919
* Add SOS1 and SOS2 reformulations for solvers not supporting them.
20+
* Improve handling of CPLEX solver quality attributes to ensure metrics such are extracted correctly when available.
2021
* Fix Xpress IIS label mapping for masked constraints and add a regression test for matching infeasible coordinates.
2122
* Enable quadratic problems with SCIP on windows.
2223

linopy/solvers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,14 +1405,16 @@ def get_solver_solution() -> Solution:
14051405
m.solution.get_values(), m.variables.get_names(), dtype=float
14061406
)
14071407

1408-
if is_lp:
1408+
try:
14091409
dual = pd.Series(
14101410
m.solution.get_dual_values(),
14111411
m.linear_constraints.get_names(),
14121412
dtype=float,
14131413
)
1414-
else:
1415-
logger.warning("Dual values of MILP couldn't be parsed")
1414+
except Exception:
1415+
logger.warning(
1416+
"Dual values not available (e.g. barrier solution without crossover)"
1417+
)
14161418
dual = pd.Series(dtype=float)
14171419
return Solution(solution, dual, objective)
14181420

0 commit comments

Comments
 (0)