From d0951abdedd11c8ae4c044905673d270e56dc52e Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 21 Mar 2024 12:02:02 +0100 Subject: [PATCH] cluster_network: allow more solvers that can handle quadratic problems --- doc/release_notes.rst | 2 ++ scripts/cluster_network.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 21094250..2982f0a6 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,6 +10,8 @@ Release Notes Upcoming Release ================ +* Allow the use of more solvers in clustering (Xpress, COPT, Gurobi, CPLEX, SCIP, MOSEK). + * Enhanced support for choosing different weather years (https://github.com/PyPSA/pypsa-eur/pull/204): diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 270774af..3f6c9ea2 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -267,7 +267,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name="scip"): m.objective = (clusters * clusters - 2 * clusters * L * n_clusters).sum() if solver_name == "gurobi": logging.getLogger("gurobipy").propagate = False - elif solver_name not in ["scip", "cplex"]: + elif solver_name not in ["scip", "cplex", "xpress", "copt", "mosek"]: logger.info( f"The configured solver `{solver_name}` does not support quadratic objectives. Falling back to `scip`." )