From 9d12f03bfb31215f373844ddcffede70df94c6f7 Mon Sep 17 00:00:00 2001 From: ksolarski Date: Tue, 20 Feb 2024 14:57:29 +0200 Subject: [PATCH 1/2] new pythons --- .github/workflows/build.yaml | 2 +- orbit/template/dlt.py | 7 +++---- orbit/template/ktrlite.py | 12 ++++++------ orbit/template/lgt.py | 6 +++--- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 73b66d33..2f934c31 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: # You can use PyPy versions in python-version. # For example, pypy2 and pypy3 matrix: - python-version: [3.9] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 diff --git a/orbit/template/dlt.py b/orbit/template/dlt.py index 40c4be88..ad288d57 100644 --- a/orbit/template/dlt.py +++ b/orbit/template/dlt.py @@ -751,10 +751,9 @@ def predict( global_trend_level + global_trend_slope * idx * self._time_delta ) elif self.global_trend_option == GlobalTrendOption.loglinear.name: - full_global_trend[ - :, idx - ] = global_trend_level + global_trend_slope * np.log( - 1 + idx * self._time_delta + full_global_trend[:, idx] = ( + global_trend_level + + global_trend_slope * np.log(1 + idx * self._time_delta) ) elif self.global_trend_option == GlobalTrendOption.logistic.name: full_global_trend[:, idx] = self.global_floor + ( diff --git a/orbit/template/ktrlite.py b/orbit/template/ktrlite.py index ce02e56a..3df5fe1c 100644 --- a/orbit/template/ktrlite.py +++ b/orbit/template/ktrlite.py @@ -190,9 +190,9 @@ def set_init_values(self): init_values = None if len(self._seasonality) > 1 and self.num_of_regressors > 0: init_values = dict() - init_values[ - RegressionSamplingParameters.COEFFICIENTS_KNOT.value - ] = np.zeros((self.num_of_regressors, self.num_knots_coefficients)) + init_values[RegressionSamplingParameters.COEFFICIENTS_KNOT.value] = ( + np.zeros((self.num_of_regressors, self.num_knots_coefficients)) + ) self._init_values = init_values def _set_default_args(self): @@ -497,9 +497,9 @@ def predict( seas_regression = np.sum( seas_coef * seasonal_regressor_matrix.transpose(1, 0), axis=-2 ) - seas_decomp[ - "seasonality_{}".format(self._seasonality[idx]) - ] = seas_regression + seas_decomp["seasonality_{}".format(self._seasonality[idx])] = ( + seas_regression + ) pos += len(cols) total_seas_regression += seas_regression if include_error: diff --git a/orbit/template/lgt.py b/orbit/template/lgt.py index d28f3b25..ad4b28c9 100644 --- a/orbit/template/lgt.py +++ b/orbit/template/lgt.py @@ -231,9 +231,9 @@ def set_init_values(self): -1.0, 1.0, ) - init_values[ - LatentSamplingParameters.INITIAL_SEASONALITY.value - ] = init_sea + init_values[LatentSamplingParameters.INITIAL_SEASONALITY.value] = ( + init_sea + ) if self.num_of_positive_regressors > 0: x = np.clip( np.random.normal( From f11d0a26667971b8db5dbbef1caff2eca3514887 Mon Sep 17 00:00:00 2001 From: ksolarski Date: Tue, 20 Feb 2024 15:06:05 +0200 Subject: [PATCH 2/2] new checkout --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2f934c31..7c164c9b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,9 +13,9 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} # You can test your matrix by printing the current Python version