From bccfd4c77fe465b9f09c47bcb1751357a9e84ee6 Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Mon, 13 Feb 2017 10:25:48 +0100 Subject: [PATCH] Fixed bug --- wafo/wave_theory/dispersion_relation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wafo/wave_theory/dispersion_relation.py b/wafo/wave_theory/dispersion_relation.py index 138a362..b6eca61 100644 --- a/wafo/wave_theory/dispersion_relation.py +++ b/wafo/wave_theory/dispersion_relation.py @@ -198,9 +198,9 @@ def w2k(w, theta=0.0, h=inf, g=9.81, count_limit=100): ix = find((np.abs(hn) > sqrt(eps) * np.abs(k)) * np.abs(hn) > sqrt(eps)) count += 1 - + max_err = np.max(hn[ix]) if np.any(ix) else 0 _assert_warn(count < count_limit, 'W2K did not converge. ' - 'Maximum error in the last step was: %13.8f' % max(hn[ix])) + 'Maximum error in the last step was: %13.8f' % max_err) k.shape = oshape