Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Upcoming Version
* Add ``linopy.breakpoints()`` factory for convenient breakpoint construction from lists, dicts, or keyword arguments. Includes ``breakpoints.segments()`` for disjunctive formulations.
* Add the `sphinx-copybutton` to the documentation
* Add SOS1 and SOS2 reformulations for solvers not supporting them.

* Improve handling of CPLEX solver quality attributes to ensure metrics such are extracted correctly when available.

Version 0.6.5
-------------
Expand Down
8 changes: 5 additions & 3 deletions linopy/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,14 +1405,16 @@ def get_solver_solution() -> Solution:
m.solution.get_values(), m.variables.get_names(), dtype=float
)

if is_lp:
try:
dual = pd.Series(
m.solution.get_dual_values(),
m.linear_constraints.get_names(),
dtype=float,
)
else:
logger.warning("Dual values of MILP couldn't be parsed")
except Exception:
logger.warning(
"Dual values not available (e.g. barrier solution without crossover)"
)
dual = pd.Series(dtype=float)
return Solution(solution, dual, objective)

Expand Down