From fd9d792599c59ce5e9cd38774b5670487c26c9a6 Mon Sep 17 00:00:00 2001 From: TobyBoyne Date: Fri, 3 May 2024 09:57:57 +0100 Subject: [PATCH] Add options to solver factory --- entmoot/optimizers/pyomo_opt.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entmoot/optimizers/pyomo_opt.py b/entmoot/optimizers/pyomo_opt.py index ca30f25..7a0c118 100644 --- a/entmoot/optimizers/pyomo_opt.py +++ b/entmoot/optimizers/pyomo_opt.py @@ -85,7 +85,11 @@ def solve( assert sum(weights) == 1.0, "weights don't add up to 1.0" # choose solver - opt = pyo.SolverFactory(self._params["solver_name"]) + opt = pyo.SolverFactory( + self._params["solver_name"], + manage_env="solver_factory_options" in self._params, + options=self._params.get("solver_factory_options", {}), + ) # set solver parameters if "solver_options" in self._params: