Skip to content

Commit

Permalink
Make error message to increase nugget more actionable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Thompson committed Oct 10, 2024
1 parent 7dd4341 commit 3a86b83
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 @@ -2296,7 +2297,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 3a86b83

Please sign in to comment.