Skip to content

Commit

Permalink
Merge pull request #841 from PyPSA/print-IIS
Browse files Browse the repository at this point in the history
print IIS if solver returns status infeasible
  • Loading branch information
fneum authored Jan 3, 2024
2 parents b786337 + 2acddb6 commit 456da8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Upcoming Release

* Remove HELMETH option.

* Print Irreducible Infeasible Subset (IIS) if model is infeasible. Only for
solvers with IIS support.

**Bugs and Compatibility**

* A bug preventing custom powerplants specified in ``data/custom_powerplants.csv`` was fixed. (https://github.com/PyPSA/pypsa-eur/pull/732)
Expand Down
3 changes: 3 additions & 0 deletions scripts/solve_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ def solve_network(n, config, solving, opts="", **kwargs):
f"Solving status '{status}' with termination condition '{condition}'"
)
if "infeasible" in condition:
labels = n.model.compute_infeasibilities()
logger.info("Labels:\n" + labels)
n.model.print_infeasibilities()
raise RuntimeError("Solving status 'infeasible'")

return n
Expand Down

0 comments on commit 456da8d

Please sign in to comment.