Misc bug-fixes

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

@ -198,7 +198,7 @@ class PlotData(object):
if return_ci: if return_ci:
res_ci = [child.integrate(a, b, method=method) res_ci = [child.integrate(a, b, method=method)
for child in self.children] for child in self.children]
return np.hstack((res, res_ci)) return np.hstack((res, np.ravel(res_ci)))
return res return res
def plot(self, *args, **kwds): def plot(self, *args, **kwds):
@ -601,8 +601,8 @@ def test_plotdata():
x = np.linspace(0, np.pi, 9) x = np.linspace(0, np.pi, 9)
xi = np.linspace(0, np.pi, 4*9) xi = np.linspace(0, np.pi, 4*9)
d = PlotData(np.sin(x)/2, x, dataCI=[], xlab='x', ylab='sin', title='sinus', d = PlotData(np.sin(x)/2, x, dataCI=[], xlab='x', ylab='sin',
plot_args=['r.']) title='sinus', plot_args=['r.'])
di = PlotData(d.eval_points(xi, method='cubic'), xi) di = PlotData(d.eval_points(xi, method='cubic'), xi)
unused_hi = di.plot() unused_hi = di.plot()
unused_h = d.plot() unused_h = d.plot()
@ -620,5 +620,5 @@ def test_docstrings():
if __name__ == '__main__': if __name__ == '__main__':
# test_docstrings() test_docstrings()
test_plotdata() # 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)] exps = [(k - n, n) for k in range(order + 1) for n in range(k + 1)]
# coordinates of points # 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) dx = np.repeat(ind, window_size)
dy = np.tile(ind, [window_size, 1]).reshape(window_size ** 2,) 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): def smooth_last(self, signal, k=0):
coeff = self._coeff coeff = self._coeff
n = np.size((coeff - 1) // 2 n = (np.size(coeff) - 1) // 2
y = np.squeeze(signal) y = np.squeeze(signal)
if n == 0: if n == 0:
return y return y

Loading…
Cancel
Save