Skip to content
Merged
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
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Upcoming Version
* 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.
* 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.
* Fix Xpress IIS label mapping for masked constraints and add a regression test for matching infeasible coordinates.
* Enable quadratic problems with SCIP on windows.

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
Loading