Skip to content

Commit dac39e0

Browse files
committed
Fix in penalty display and better settings for DIRECT
1 parent b2f8d9e commit dac39e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xdeps/optimize/optimize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def __call__(self, x=None, check_limits=None, return_scalar=None, zero_if_met=No
377377
if self.show_call_counter:
378378
_print(
379379
f"Matching: model call n. {self.call_counter} "
380-
+ (f"penalty = {out:.4g}" if return_scalar else "")
380+
+ (f"penalty = {np.sqrt(out):.4g}" if return_scalar else "")
381381
+ " ",
382382
end="\r",
383383
flush=True,
@@ -901,6 +901,7 @@ def run_direct(self, n_steps=1000, verbose=True, **kwargs):
901901
merit_function = self.get_merit_function(return_scalar=True)
902902
bounds = merit_function.get_x_limits()
903903
res = direct(merit_function, bounds=list(bounds), maxiter=n_steps,
904+
maxfun=len(bounds) * n_steps,
904905
**kwargs)
905906
self._last_direct_res = res
906907
merit_function.set_x(res.x)

0 commit comments

Comments
 (0)