diff --git a/pypesto/history/optimizer.py b/pypesto/history/optimizer.py index a4876b111..46524a0c1 100644 --- a/pypesto/history/optimizer.py +++ b/pypesto/history/optimizer.py @@ -134,7 +134,7 @@ def finalize(self, message: str = None, exitflag: int = None): and not allclose(result[X], self.x_min) ): # issue a warning, as if this happens, then something may be wrong - logger.warn( + logger.warning( f"History has a better point {fval} than the current best " "point {self.fval_min}." ) diff --git a/pypesto/optimize/optimizer.py b/pypesto/optimize/optimizer.py index d44c372f1..6bd689fcc 100644 --- a/pypesto/optimize/optimizer.py +++ b/pypesto/optimize/optimizer.py @@ -608,7 +608,7 @@ def get_default_options(self): def check_x0_support(self, x_guesses: np.ndarray = None) -> bool: """Check whether optimizer supports x0.""" if x_guesses is not None and x_guesses.size > 0: - logger.warn("The Dlib optimizer does not support x0.") + logger.warning("The Dlib optimizer does not support x0.") return False @@ -666,7 +666,7 @@ def is_least_squares(self): def check_x0_support(self, x_guesses: np.ndarray = None) -> bool: """Check whether optimizer supports x0.""" if x_guesses is not None and x_guesses.size > 0: - logger.warn("The pyswarm optimizer does not support x0.") + logger.warning("The pyswarm optimizer does not support x0.") return False @@ -940,7 +940,7 @@ def is_least_squares(self): def check_x0_support(self, x_guesses: np.ndarray = None) -> bool: """Check whether optimizer supports x0.""" if x_guesses is not None and x_guesses.size > 0: - logger.warn("The pyswarms optimizer does not support x0.") + logger.warning("The pyswarms optimizer does not support x0.") return False @@ -1186,7 +1186,7 @@ def check_x0_support(self, x_guesses: np.ndarray = None) -> bool: nlopt.GN_DIRECT_L_RAND_NOSCAL, ): if x_guesses is not None and x_guesses.size > 0: - logger.warn( + logger.warning( f"The NLopt optimizer method {self.method} does " "not support x0." ) diff --git a/pypesto/profile/profile.py b/pypesto/profile/profile.py index 056c21a79..30d1b303e 100644 --- a/pypesto/profile/profile.py +++ b/pypesto/profile/profile.py @@ -135,6 +135,10 @@ def create_next_guess( for i_par in profile_index: # only compute profiles for free parameters if i_par in problem.x_fixed_indices: + # log a warning + logger.warning( + f"Parameter {i_par} is fixed and will not be profiled." + ) continue current_profile = result.profile_result.get_profiler_result(