Commit 168f967a authored by Martin Reinecke's avatar Martin Reinecke
Browse files

warn() -> warning()

parent d5fe215d
Pipeline #26055 passed with stage
in 5 minutes and 26 seconds
......@@ -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 "
logger.warning("directional derivative has non-negligible "
"imaginary part:", res)
return res.real
......@@ -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")
"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, False
phi_alpha0 = phi_alpha1
phiprime_alpha0 = phiprime_alpha1
logger.warn("max iterations reached")
logger.warning("max iterations reached")
return, False
def _zoom(self, alpha_lo, alpha_hi, phi_0, phiprime_0,
......@@ -252,7 +253,8 @@ class LineSearchStrongWolfe(LineSearch):
logger.warn("The line search algorithm (zoom) did not converge.")
"The line search algorithm (zoom) did not converge.")
return, False
def _cubicmin(self, a, fa, fpa, b, fb, c, fc):
......@@ -86,7 +86,7 @@ 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 "
logger.warning("WARNING: Field has a space in `domain` which is "
"neither harmonic nor a PowerSpace.")
spaces = utilities.parse_spaces(spaces, len(field.domain))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment