From 257b16efd8efae8848171083c1d4c04ab4af9579 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 3 Jan 2024 13:47:13 +0100 Subject: [PATCH 1/2] print IIS if solver returns status infeasible --- scripts/solve_network.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index ff2a2f232..8c46e0252 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -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 From 2acddb6a7ccf1c6d30bcf8d452e7c2bd61a7a36c Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 3 Jan 2024 13:48:34 +0100 Subject: [PATCH 2/2] add release note --- doc/release_notes.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 5ac7925e1..31e492a81 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -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)