Solver Utilities¶
Check which Pyomo solvers and OR-Tools backends are installed and available in the current environment (e.g. before choosing a solver for OPF or TEP).
Functions are found in pyflow_acdc.solver_utils.
- check_available_solvers(pyomo_solvers=None, include_ortools=True, verbose=True)[source]¶
Report which Pyomo solvers and OR-Tools backends are installed and available.
- Parameters:
pyomo_solvers (list of str, optional) – Solver names to probe; defaults to a built-in list (cbc, glpk, ipopt, bonmin, gurobi, …).
include_ortools (bool, optional) – When
True, also report OR-Tools LP/MIP backend availability.verbose (bool, optional) – Print a human-readable report to stdout.
- Returns:
Keys include
pyomo_available,pyomo_errors, and (wheninclude_ortools)ortools_installed,ortools_available.- Return type:
dict
- is_pyomo_solver_available(solver_name)[source]¶
Return
Trueif a Pyomo solver is installed and available.Uses
SolverFactory(...).available(False)so missing executables are detected without raising (unlikeavailable()with no argument).Return
Trueif a named Pyomo solver executable is installed (e.g. probe for'gurobi'before choosing array MIP/CSS defaults — see Wind Farm Array Sizing Module).