diff --git a/nifty4/minimization/line_energy.py b/nifty4/minimization/line_energy.py index 742f06e6c9a9c32def8cc62cf29efab9bc5f4d88..962271a9fdc257477f52bb8a12a7d533ebc8f7c0 100644 --- a/nifty4/minimization/line_energy.py +++ b/nifty4/minimization/line_energy.py @@ -96,6 +96,6 @@ class LineEnergy(object): res = self._energy.gradient.vdot(self._line_direction) if abs(res.imag) / max(abs(res.real), 1.) > 1e-12: from ..logger import logger - logger.warn("directional derivative has non-negligible " - "imaginary part:", res) + logger.warning("directional derivative has non-negligible " + "imaginary part:", res) return res.real diff --git a/nifty4/minimization/line_search_strong_wolfe.py b/nifty4/minimization/line_search_strong_wolfe.py index 1e0137d0ea3800b45221b0c10fe282e2400eb02c..284455d67d910136fe6e58ed62ea33e3d3834dda 100644 --- a/nifty4/minimization/line_search_strong_wolfe.py +++ b/nifty4/minimization/line_search_strong_wolfe.py @@ -100,7 +100,8 @@ class LineSearchStrongWolfe(LineSearch): phi_0 = le_0.value phiprime_0 = le_0.directional_derivative if phiprime_0 == 0: - logger.warn("Directional derivative is zero; assuming convergence") + logger.warning( + "Directional derivative is zero; assuming convergence") return energy, False if phiprime_0 > 0: logger.error("Error: search direction is not a descent direction") @@ -149,13 +150,13 @@ class LineSearchStrongWolfe(LineSearch): # update alphas alpha0, alpha1 = alpha1, min(2*alpha1, maxstepsize) if alpha1 == maxstepsize: - logger.warn("max step size reached") + logger.warning("max step size reached") return le_alpha1.energy, False phi_alpha0 = phi_alpha1 phiprime_alpha0 = phiprime_alpha1 - logger.warn("max iterations reached") + logger.warning("max iterations reached") return le_alpha1.energy, False def _zoom(self, alpha_lo, alpha_hi, phi_0, phiprime_0, @@ -252,7 +253,8 @@ class LineSearchStrongWolfe(LineSearch): phiprime_alphaj) else: - logger.warn("The line search algorithm (zoom) did not converge.") + logger.warning( + "The line search algorithm (zoom) did not converge.") return le_alphaj.energy, False def _cubicmin(self, a, fa, fpa, b, fb, c, fc): diff --git a/nifty4/sugar.py b/nifty4/sugar.py index aa43de37f90d57d45e5a670782f38f6573cabd8a..48402434daac8af578fbdae902c3cae46122170f 100644 --- a/nifty4/sugar.py +++ b/nifty4/sugar.py @@ -86,8 +86,8 @@ def power_analyze(field, spaces=None, binbounds=None, for sp in field.domain: if not sp.harmonic and not isinstance(sp, PowerSpace): - logger.warn("WARNING: Field has a space in `domain` which is " - "neither harmonic nor a PowerSpace.") + logger.warning("WARNING: Field has a space in `domain` which is " + "neither harmonic nor a PowerSpace.") spaces = utilities.parse_spaces(spaces, len(field.domain))