only recurse if optimization was successful
@@ -700,13 +700,9 @@ class BaseOptimizer(with_metaclass(ABCMeta, object)):
minimizer_kwargs = {'bounds': [(0, 0) if np.isclose(x, 0) else (0, 1) for x in x0],
'tol': None,
'callback': None,
+ 'constraints': self.constraints,
}
- try:
- minimizer_kwargs['constraints'] = self.constraints
- except AttributeError:
- pass
-
try: # pragma: no cover
if callable(self._jacobian):
minimizer_kwargs['jac'] = self._jacobian
