From 47d94c29e5015aa0c1581a297014ccb359555246 Mon Sep 17 00:00:00 2001 From: cerlymarco <36955807+cerlymarco@users.noreply.github.com> Date: Sun, 4 Jul 2021 16:41:36 +0200 Subject: [PATCH] Release --- setup.py | 2 +- tsmoothie/smoother.py | 11 +++++------ tsmoothie/utils_class.py | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 6d9adb3..bff1644 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ HERE = pathlib.Path(__file__).parent -VERSION = '1.0.2' +VERSION = '1.0.3' PACKAGE_NAME = 'tsmoothie' AUTHOR = 'Marco Cerliani' AUTHOR_EMAIL = 'cerlymarco@gmail.com' diff --git a/tsmoothie/smoother.py b/tsmoothie/smoother.py index 8695981..dc92fb8 100644 --- a/tsmoothie/smoother.py +++ b/tsmoothie/smoother.py @@ -1260,13 +1260,12 @@ def smooth(self, data): seasonal = [np.tile(p_a, (1, nobs // periods[i] + 1))[:, :nobs] for i, p_a in enumerate(period_averages)] - if self.method == 'additive': - smooth = smoother.smooth_data - for season in seasonal: + data = smoother.data + smooth = smoother.smooth_data + for season in seasonal: + if self.method == 'additive': smooth += season - else: - smooth = smoother.smooth_data - for season in seasonal: + else: smooth *= season self._store_results(smooth_data=smooth, data=data) diff --git a/tsmoothie/utils_class.py b/tsmoothie/utils_class.py index 4d7947b..46d456f 100644 --- a/tsmoothie/utils_class.py +++ b/tsmoothie/utils_class.py @@ -140,8 +140,8 @@ def fit(self, X, y, sample_weight): self : returns an instance of self """ - X, y, X_offset, y_offset, X_scale = self._preprocess_data(X, y, - sample_weight=sample_weight) + X, y, X_offset, y_offset, X_scale = self._preprocess_data( + X, y, sample_weight=sample_weight) if np.unique(sample_weight).shape[0] > 1: X, y = self._rescale_data(X, y, sample_weight)