Skip to content
Snippets Groups Projects
Commit 168f967a authored by Martin Reinecke's avatar Martin Reinecke
Browse files

warn() -> warning()

parent d5fe215d
No related branches found
No related tags found
1 merge request!232Logging
Pipeline #
......@@ -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
......@@ -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):
......
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment