From 2c655912260190244c7bf3edd92bc75e308e2ff0 Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Mon, 20 Feb 2017 17:43:04 +0100 Subject: [PATCH] Try to fix mysterious "TypeError('only integer scalar arrays can be converted to a scalar index',)" exception error in findcross. --- wafo/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wafo/misc.py b/wafo/misc.py index fa5cb7f..4ee0fc8 100644 --- a/wafo/misc.py +++ b/wafo/misc.py @@ -853,7 +853,7 @@ def _findcross(xn, method='clib'): ''' if clib is not None and method == 'clib': ind, m = clib.findcross(xn, 0.0) - return ind[:m] + return ind[:int(m)] return numba_misc.findcross(xn) @@ -2494,7 +2494,7 @@ def _discretize_adaptive(fun, a, b, tol=0.005, n=5): x = linspace(a, b, n) fx = fun(x) - n2 = (n - 1) / 2 + n2 = (n - 1) // 2 erri = hstack((zeros((n2, 1)), ones((n2, 1)))).ravel() err = erri.max() err0 = inf