From 40c289b11163d23b62744231153608c10f388574 Mon Sep 17 00:00:00 2001 From: cerlymarco <36955807+cerlymarco@users.noreply.github.com> Date: Thu, 15 Jul 2021 09:47:08 +0200 Subject: [PATCH] Release --- setup.py | 2 +- tsmoothie/smoother.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bff1644..e6e5e27 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ HERE = pathlib.Path(__file__).parent -VERSION = '1.0.3' +VERSION = '1.0.4' PACKAGE_NAME = 'tsmoothie' AUTHOR = 'Marco Cerliani' AUTHOR_EMAIL = 'cerlymarco@gmail.com' diff --git a/tsmoothie/smoother.py b/tsmoothie/smoother.py index dc92fb8..9125bf0 100644 --- a/tsmoothie/smoother.py +++ b/tsmoothie/smoother.py @@ -483,7 +483,12 @@ def smooth(self, data): else: rfft[n_coeff:] = 0 - smooth = np.fft.irfft(rfft, axis=0) + if data.shape[0] % 2 > 0: + n = 2 * rfft.shape[0] - 1 + else: + n = 2 * (rfft.shape[0] - 1) + + smooth = np.fft.irfft(rfft, n=n, axis=0) smooth = smooth[self.pad_len:-self.pad_len] smooth = _check_output(smooth)