Misc bug-fixes

master
Per A Brodtkorb 8 years ago
parent 5d26fa9b21
commit d5f440f5bf

@ -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()

@ -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,)

@ -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

Loading…
Cancel
Save