From d5f440f5bf1d2de61eaa110885377a47c709dada Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Mon, 29 Aug 2016 01:38:35 +0200 Subject: [PATCH] Misc bug-fixes --- wafo/containers.py | 10 +++++----- wafo/interpolate.py | 2 +- wafo/sg_filter.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wafo/containers.py b/wafo/containers.py index fe3d65c..661b165 100644 --- a/wafo/containers.py +++ b/wafo/containers.py @@ -198,7 +198,7 @@ class PlotData(object): if return_ci: res_ci = [child.integrate(a, b, method=method) for child in self.children] - return np.hstack((res, res_ci)) + return np.hstack((res, np.ravel(res_ci))) return res def plot(self, *args, **kwds): @@ -601,8 +601,8 @@ def test_plotdata(): x = np.linspace(0, np.pi, 9) xi = np.linspace(0, np.pi, 4*9) - d = PlotData(np.sin(x)/2, x, dataCI=[], xlab='x', ylab='sin', title='sinus', - plot_args=['r.']) + d = PlotData(np.sin(x)/2, x, dataCI=[], xlab='x', ylab='sin', + title='sinus', plot_args=['r.']) di = PlotData(d.eval_points(xi, method='cubic'), xi) unused_hi = di.plot() unused_h = d.plot() @@ -620,5 +620,5 @@ def test_docstrings(): if __name__ == '__main__': - # test_docstrings() - test_plotdata() + test_docstrings() + # test_plotdata() diff --git a/wafo/interpolate.py b/wafo/interpolate.py index b456593..b3526e0 100644 --- a/wafo/interpolate.py +++ b/wafo/interpolate.py @@ -222,7 +222,7 @@ def sgolay2d(z, window_size, order, derivative=None): exps = [(k - n, n) for k in range(order + 1) for n in range(k + 1)] # coordinates of points - ind = np.arange(-half_size, half_size + 1, dtype=np.float64) + ind = np.arange(-half_size, half_size + 1, dtype=np.float) dx = np.repeat(ind, window_size) dy = np.tile(ind, [window_size, 1]).reshape(window_size ** 2,) diff --git a/wafo/sg_filter.py b/wafo/sg_filter.py index 22a6533..999c4cd 100644 --- a/wafo/sg_filter.py +++ b/wafo/sg_filter.py @@ -132,7 +132,7 @@ class SavitzkyGolay(object): def smooth_last(self, signal, k=0): coeff = self._coeff - n = np.size((coeff - 1) // 2 + n = (np.size(coeff) - 1) // 2 y = np.squeeze(signal) if n == 0: return y