Skip to content

Commit 5013703

Browse files
authored
Make automlx an optional dependency (#775)
2 parents 7e89d18 + 765d2de commit 5013703

File tree

16 files changed

+743
-131
lines changed

16 files changed

+743
-131
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Forecast Operator Tests"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ "main", "operators/**" ]
7+
8+
# Cancel in progress workflows on pull_requests.
9+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
18+
env:
19+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
20+
21+
jobs:
22+
test:
23+
name: python ${{ matrix.python-version }}
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 180
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
python-version: ["3.8"]
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
cache: "pip"
39+
cache-dependency-path: |
40+
pyproject.toml
41+
"**requirements.txt"
42+
"test-requirements-operators.txt"
43+
44+
- uses: ./.github/workflows/set-dummy-conf
45+
name: "Test config setup"
46+
47+
- name: "Run Forecast Tests"
48+
timeout-minutes: 180
49+
shell: bash
50+
run: |
51+
set -x # print commands that are executed
52+
$CONDA/bin/conda init
53+
source /home/runner/.bashrc
54+
pip install -r test-requirements-operators.txt
55+
python -m pytest -v -p no:warnings --durations=5 tests/operators/forecast

.github/workflows/run-operators-unit-tests.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
name: "[Py3.8][Py3.10] Operators Tests"
1+
name: "Operators Tests"
22

33
on:
44
workflow_dispatch:
55
pull_request:
6-
paths:
7-
- "ads/opctl/operator/**"
8-
- "**requirements.txt"
9-
- ".github/workflows/run-operators*.yml"
10-
- "test-requirements-operators.txt"
6+
branches: [ "main", "operators/**" ]
117

128
# Cancel in progress workflows on pull_requests.
139
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -56,4 +52,4 @@ jobs:
5652
$CONDA/bin/conda init
5753
source /home/runner/.bashrc
5854
pip install -r test-requirements-operators.txt
59-
python -m pytest -v -p no:warnings --durations=5 tests/operators
55+
python -m pytest -v -p no:warnings --durations=5 tests/operators --ignore=tests/operators/forecast

ads/opctl/operator/lowcode/anomaly/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ To run anomaly detection locally, create and activate a new conda environment (`
3737
```yaml
3838
- report-creator
3939
- cerberus
40-
- oracle-automlx==23.4.1
41-
- oracle-automlx[classic]==23.4.1
4240
- "git+https://github.com/oracle/accelerated-data-science.git@feature/anomaly#egg=oracle-ads"
4341
```
4442

ads/opctl/operator/lowcode/anomaly/environment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ dependencies:
77
- pip:
88
- report-creator
99
- cerberus
10-
- oracle-automlx==23.4.1
11-
- oracle-automlx[classic]==23.4.1
1210
- "oracle-ads[anomaly]"

ads/opctl/operator/lowcode/anomaly/model/automlx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class AutoMLXOperatorModel(AnomalyOperatorBaseModel):
1919
@runtime_dependency(
2020
module="automlx",
2121
err_msg=(
22-
"Please run `pip3 install oracle-automlx==23.4.1` and "
23-
"`pip3 install oracle-automlx[classic]==23.4.1` "
22+
"Please run `pip3 install oracle-automlx>=23.4.1` and "
23+
"`pip3 install oracle-automlx[classic]>=23.4.1` "
2424
"to install the required dependencies for automlx."
2525
),
2626
)

ads/opctl/operator/lowcode/forecast/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ To run forecasting locally, create and activate a new conda environment (`ads-fo
3838
- report-creator
3939
- cerberus
4040
- sktime
41-
- optuna==3.1.0
42-
- oracle-automlx==23.4.1
43-
- oracle-automlx[forecasting]==23.4.1
41+
- optuna
4442
- oracle-ads>=2.9.0
4543
```
4644

ads/opctl/operator/lowcode/forecast/environment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ dependencies:
1616
- shap
1717
- autots[additional]
1818
- optuna
19-
- oracle-automlx>=23.4.1
20-
- oracle-automlx[forecasting]>=23.4.1
2119
- fire

ads/opctl/operator/lowcode/forecast/model/automlx.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def preprocess(self, data, series_id=None): # TODO: re-use self.le for explanat
6262
@runtime_dependency(
6363
module="automlx",
6464
err_msg=(
65-
"Please run `pip3 install oracle-automlx==23.4.1` and "
66-
"`pip3 install oracle-automlx[forecasting]==23.4.1` "
65+
"Please run `pip3 install oracle-automlx>=23.4.1` and "
66+
"`pip3 install oracle-automlx[forecasting]>=23.4.1` "
6767
"to install the required dependencies for automlx."
6868
),
6969
)
@@ -113,7 +113,9 @@ def _build_model(self) -> pd.DataFrame:
113113
data_i = self.drop_horizon(data)
114114
X_pred = self.get_horizon(data).drop(target, axis=1)
115115

116-
logger.debug(f"Time Index Monotonic: {data_i.index.is_monotonic}")
116+
logger.debug(
117+
f"Time Index Monotonic: {data_i.index.is_monotonic_increasing}"
118+
)
117119

118120
if self.loaded_models is not None and s_id in self.loaded_models:
119121
model = self.loaded_models[s_id]

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,11 @@ forecast = [
138138
"py-cpuinfo",
139139
"rich",
140140
"autots[additional]",
141-
"holidays==0.21.13",
142-
"neuralprophet",
141+
"neuralprophet>=0.7.0",
143142
"numpy",
144143
"oci-cli",
145-
"optuna==3.1.0",
144+
"optuna",
146145
"oracle-ads",
147-
"oracle-automlx[forecasting]==23.4.1",
148-
"oracle-automlx[classic]==23.4.1",
149146
"pmdarima",
150147
"prophet",
151148
"shap",
@@ -158,8 +155,6 @@ forecast = [
158155
anomaly = [
159156
"oracle_ads[opctl]",
160157
"autots",
161-
"oracle-automlx[forecasting]==23.4.1",
162-
"oracle-automlx[classic]==23.4.1",
163158
"oracledb",
164159
"report-creator",
165160
]

test-requirements-operators.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-r test-requirements.txt
22
-e ".[forecast]"
33
-e ".[feature-store-marketplace]"
4-
darts>=0.28
54
plotly
5+
oracle-automlx[classic]>=24.1.0
6+
oracle-automlx[forecasting]>=24.1.0
7+
pandas>=2.0.0
8+
protobuf==3.20.3

0 commit comments

Comments
 (0)