Skip to content

Commit 413ad3d

Browse files
authored
Adding missing display option to scipy_slsqp (#586)
1 parent 39251d1 commit 413ad3d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

docs/source/algorithms.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ install optimagic.
8686
f in the stopping criterion.
8787
- **stopping.maxiter** (int): If the maximum number of iterations is reached,
8888
the optimization stops, but we do not count this as convergence.
89+
- **display** (bool):
90+
Set to True to print convergence messages. Default is False.
91+
- scipy name: **disp**
8992
9093
```
9194

src/optimagic/optimizers/scipy_optimizers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,15 @@ def _solve_internal_problem(
145145
class ScipySLSQP(Algorithm):
146146
convergence_ftol_abs: NonNegativeFloat = CONVERGENCE_SECOND_BEST_FTOL_ABS
147147
stopping_maxiter: PositiveInt = STOPPING_MAXITER
148+
display: bool = False
148149

149150
def _solve_internal_problem(
150151
self, problem: InternalOptimizationProblem, x0: NDArray[np.float64]
151152
) -> InternalOptimizeResult:
152153
options = {
153154
"maxiter": self.stopping_maxiter,
154155
"ftol": self.convergence_ftol_abs,
156+
"disp": self.display,
155157
}
156158
raw_res = scipy.optimize.minimize(
157159
fun=problem.fun_and_jac,

0 commit comments

Comments
 (0)