Skip to content

Commit 962b17e

Browse files
authored
fix(solvers): add forgotten xpress getDual fallback (#547)
1 parent 5671eb1 commit 962b17e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

linopy/solvers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,11 @@ def get_solver_solution() -> Solution:
17021702
sol = pd.Series(m.getSolution(), index=var, dtype=float)
17031703

17041704
try:
1705-
_dual = m.getDuals()
1705+
try: # Try new API first
1706+
_dual = m.getDuals()
1707+
except AttributeError: # Fallback to old API
1708+
_dual = m.getDual()
1709+
17061710
try: # Try new API first
17071711
constraints = m.getNameList(
17081712
xpress_Namespaces.ROW, 0, m.attributes.rows - 1

0 commit comments

Comments
 (0)