cluster_network: allow more solvers that can handle quadratic problems

This commit is contained in:
Fabian Neumann 2024-03-21 12:02:02 +01:00
parent 899c8828f0
commit d0951abded
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -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`."
)