Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test For Newer Python Versions #849

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ 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
- 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
Expand Down
7 changes: 3 additions & 4 deletions orbit/template/dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + (
Expand Down
12 changes: 6 additions & 6 deletions orbit/template/ktrlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions orbit/template/lgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down