Skip to content

Commit 6e2b0df

Browse files
authored
Add support for numpy>=2.0.0 (#2771)
* relexnumpy v2 upper cap * remove bats and tbats * run macos only * run on macos-14 (silicon) * run develop workflow on macos-14 (silicon) * test * run all macos tests * run failing tests * change cp test * further adapt tests * another failing test * fix last test * fix elec zurich ds for arm processors * check dataset loading * complete macos tests * fix last failing macos tests * another test fix for macos * run failing ubuntu tests * check explicit failing tests * try setting locale sorting * try fix sorting * run all tabularization tests * update workflows * remove macos uv install step * try removing libomp installation step since new macos-14 build * remove unused limbomp istall scripts * update changelog
1 parent f5d9055 commit 6e2b0df

File tree

16 files changed

+34
-62
lines changed

16 files changed

+34
-62
lines changed

.github/scripts/libomp-Linux.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/scripts/libomp-macOS.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/develop.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ${{ matrix.os }}
3232
strategy:
3333
matrix:
34-
os: [macos-13, ubuntu-latest]
34+
os: [macos-14, ubuntu-latest]
3535
python-version: ['3.10']
3636
flavour: ['all']
3737

@@ -48,9 +48,6 @@ jobs:
4848
- name: "Compile Dependency Versions"
4949
run: |
5050
curl -LsSf https://astral.sh/uv/install.sh | sh
51-
if [ "${{ matrix.os }}" == "macos-13" ]; then
52-
source $HOME/.local/bin/env
53-
fi
5451
uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
5552
5653
- name: "Cache python environment"
@@ -69,10 +66,6 @@ jobs:
6966
# install latest dependencies (potentially updating cached dependencies)
7067
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
7168
72-
- name: "Install libomp (for LightGBM)"
73-
run: |
74-
./.github/scripts/libomp-${{ runner.os }}.sh
75-
7669
- name: "Run tests"
7770
run: |
7871
pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
@@ -122,10 +115,6 @@ jobs:
122115
# install latest dependencies (potentially updating cached dependencies)
123116
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
124117
125-
- name: "Install libomp (for LightGBM)"
126-
run: |
127-
./.github/scripts/libomp-${{ runner.os }}.sh
128-
129118
- name: "Install Locally"
130119
run: |
131120
pip install .
@@ -171,10 +160,6 @@ jobs:
171160
# install latest dependencies (potentially updating cached dependencies)
172161
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
173162
174-
- name: "Install libomp (for LightGBM)"
175-
run: |
176-
./.github/scripts/libomp-${{ runner.os }}.sh
177-
178163
- name: "Install Locally"
179164
run: |
180165
pip install .

.github/workflows/doc.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242
# install latest dependencies (potentially updating cached dependencies)
4343
pip install -U -r requirements/dev-all.txt
4444
45-
- name: "Install libomp (for LightGBM)"
46-
run: |
47-
./.github/scripts/libomp-${{ runner.os }}.sh
48-
4945
- name: "Install Locally"
5046
run: |
5147
pip install .

.github/workflows/merge.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ${{ matrix.os }}
3131
strategy:
3232
matrix:
33-
os: [macos-13, ubuntu-latest]
33+
os: [macos-14, ubuntu-latest]
3434
python-version: ['3.9', '3.11']
3535
flavour: ['core', 'torch', 'all']
3636

@@ -57,10 +57,6 @@ jobs:
5757
pip install -r requirements/core.txt -r requirements/torch.txt -r requirements/notorch.txt -r requirements/optional.txt -r requirements/dev.txt
5858
fi
5959
60-
- name: "Install libomp (for LightGBM)"
61-
run: |
62-
./.github/scripts/libomp-${{ runner.os }}.sh
63-
6460
- name: "Run tests"
6561
run: |
6662
if [ "${{ matrix.flavour }}" == "all" ]; then
@@ -113,10 +109,6 @@ jobs:
113109
# install latest dependencies (potentially updating cached dependencies)
114110
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
115111
116-
- name: "Install libomp (for LightGBM)"
117-
run: |
118-
./.github/scripts/libomp-${{ runner.os }}.sh
119-
120112
- name: "Install Locally"
121113
run: |
122114
pip install .
@@ -164,10 +156,6 @@ jobs:
164156
# install latest dependencies (potentially updating cached dependencies)
165157
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
166158
167-
- name: "Install libomp (for LightGBM)"
168-
run: |
169-
./.github/scripts/libomp-${{ runner.os }}.sh
170-
171159
- name: "Install Locally"
172160
run: |
173161
pip install .

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ jobs:
140140
# install latest dependencies (potentially updating cached dependencies)
141141
pip install -U -r requirements/dev-all.txt
142142
143-
- name: "Install libomp (for LightGBM)"
144-
run: |
145-
./.github/scripts/libomp-${{ runner.os }}.sh
146-
147143
- name: "Install Locally"
148144
run: |
149145
pip install .

.github/workflows/update-cache.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
os: [macos-13, ubuntu-latest]
14+
os: [macos-14, ubuntu-latest]
1515
python-version: ['3.10']
1616
flavour: ['all']
1717

@@ -28,9 +28,6 @@ jobs:
2828
- name: "Compile Dependency Versions"
2929
run: |
3030
curl -LsSf https://astral.sh/uv/install.sh | sh
31-
if [ "${{ matrix.os }}" == "macos-13" ]; then
32-
source $HOME/.local/bin/env
33-
fi
3431
uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
3532
3633
- name: "Cache python environment"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co
1111

1212
**Improved**
1313

14+
- Added support for `numpy>=2.0.0`. [#2771](https://github.com/unit8co/darts/pull/2771) by [Dennis Bader](https://github.com/dennisbader).
1415
- Added support for categorical covariates to `CatBoostModel`. You can now define categorical components at model creation with parameters `categorical_*_covariates: List[str]` for past, future, and static covariates. [#2733](https://github.com/unit8co/darts/pull/2750) by [Jonas Blanc](https://github.com/jonasblanc).
1516
- Added new forecasting model: `AutoMFLES`, a simple time series method based on gradient boosting time series decomposition as proposed in [this repository](https://github.com/tblume1992/MFLES). This implementation is based on [AutoMFLES](https://nixtlaverse.nixtla.io/statsforecast/docs/models/mfles.html) from Nixtla's `statsforecasts` library. [#2747](https://github.com/unit8co/darts/pull/2747) by [Che Hang Ng](https://github.com/CheHangNg).
1617
- Added new forecasting model: `StatsForecastModel`, that allows to use any forecasting model from StatsForecast (see [here](https://nixtlaverse.nixtla.io/statsforecast/index.html#models)) in Darts with support for future covariates, probabilistic forecasting, and transferable series forecasting. [#2770](https://github.com/unit8co/darts/pull/2770) by [Dennis Bader](https://github.com/dennisbader).

darts/datasets/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
A few popular time series datasets
66
"""
77

8+
import platform
89
from pathlib import Path
910

1011
import numpy as np
@@ -932,7 +933,11 @@ def pre_process_dataset(dataset_path):
932933
"ewz_stromabgabe_netzebenen_stadt_zuerich/"
933934
"download/ewz_stromabgabe_netzebenen_stadt_zuerich.csv"
934935
),
935-
hash="a019125b7f9c1afeacb0ae60ce7455ef",
936+
hash=(
937+
"1e21d679e972ce34a1db8320be9eec39"
938+
if platform.processor().startswith("arm")
939+
else "a019125b7f9c1afeacb0ae60ce7455ef"
940+
),
936941
header_time="Timestamp",
937942
freq="15min",
938943
pre_process_csv_fn=pre_process_dataset,

darts/tests/models/forecasting/test_conformal_model.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,11 @@ def test_stridden_conformal_model(self, config):
10921092
hfc_conf_lpo = concatenate(
10931093
[hfc[-1::cal_stride] for hfc in hfc_conf], axis=0
10941094
)
1095-
assert hfc_lpo == hfc_conf_lpo
1095+
assert hfc_lpo.time_index.equals(hfc_conf_lpo.time_index)
1096+
assert hfc_lpo.columns.equals(hfc_conf_lpo.columns)
1097+
np.testing.assert_array_almost_equal(
1098+
hfc_lpo.all_values(), hfc_conf_lpo.all_values()
1099+
)
10961100

10971101
# checking that predict gives the same results as last historical forecast
10981102
preds = model.predict(
@@ -1112,7 +1116,11 @@ def test_stridden_conformal_model(self, config):
11121116
)
11131117
hfcs_conf_end = [hfc[-1] for hfc in hfcs_conf_end]
11141118
for pred, last_hfc in zip(preds, hfcs_conf_end):
1115-
assert pred == last_hfc
1119+
assert pred.time_index.equals(last_hfc.time_index)
1120+
assert pred.columns.equals(last_hfc.columns)
1121+
np.testing.assert_array_almost_equal(
1122+
pred.all_values(), last_hfc.all_values()
1123+
)
11161124

11171125
def test_probabilistic_historical_forecast(self):
11181126
"""Checks correctness of naive conformal historical forecast from probabilistic fc model compared to

0 commit comments

Comments
 (0)