Skip to content

Commit

Permalink
Merge pull request PyPSA#330 from dannyopts/bugfix/gurobi_closed_env
Browse files Browse the repository at this point in the history
Get solution for gurobi before exiting enviornment context manager
  • Loading branch information
FabianHofmann authored Jul 23, 2024
2 parents 88ea5bc + 4735725 commit 7b1ebdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linopy/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ def get_solver_solution() -> Solution:

return Solution(sol, dual, objective)

solution = safe_get_solution(status, get_solver_solution)
maybe_adjust_objective_sign(solution, model.objective.sense, io_api)
solution = safe_get_solution(status, get_solver_solution)
maybe_adjust_objective_sign(solution, model.objective.sense, io_api)

return Result(status, solution, m)

Expand Down

0 comments on commit 7b1ebdc

Please sign in to comment.