Skip to content

Commit

Permalink
Make error message to increase nugget more actionable. (SMTorg#661)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Thompson <[email protected]>
  • Loading branch information
NAThompson and Nick Thompson authored Oct 14, 2024
1 parent 1d5e1f5 commit 34d1c13
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion smt/surrogate_models/krg_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This package is distributed under New BSD license.
"""

import sys
import warnings
from copy import deepcopy
from enum import Enum
Expand Down Expand Up @@ -2328,7 +2329,16 @@ def hessian_minus_reduced_likelihood_function(log10t):
)
# Optimization fail
elif np.size(best_optimal_par) == 0:
print("Optimization failed. Try increasing the ``nugget``")
nugget = self.options["nugget"]
print(
"\033[91mOptimization failed.\033[0m",
end="",
file=sys.stderr,
)
print(
f" Try increasing the 'nugget' above its current value of {nugget}.",
file=sys.stderr,
)
raise ve
# Break the while loop
else:
Expand Down

0 comments on commit 34d1c13

Please sign in to comment.