diff --git a/smt/surrogate_models/krg_based.py b/smt/surrogate_models/krg_based.py index dd5802334..ebd1d2e08 100644 --- a/smt/surrogate_models/krg_based.py +++ b/smt/surrogate_models/krg_based.py @@ -4,6 +4,7 @@ This package is distributed under New BSD license. """ +import sys import warnings from copy import deepcopy from enum import Enum @@ -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: