Skip to content

Commit 23e895a

Browse files
Merge branch 'unit8co:master' into master
2 parents db1e747 + b0ccd3a commit 23e895a

316 files changed

Lines changed: 307654 additions & 17261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

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

.coveragerc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[run]
22
source=darts
3-
omit=darts/tests/*
3+
omit =
4+
darts/tests/*
5+
darts/models/components/timesfm2p5_submodels.py
6+
darts/models/components/patchtst_fm_submodels.py
7+
darts/utils/callbacks.py

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
**/__pycache__
44

55
# Test files
6-
darts/tests/
76
darts/examples/static
87
**/darts_logs

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
8158d3eaef9d9f6e04f219b029e306d1f1be46d5
99
# Change Python target-version to 3.9 and update Ruff to 0.7.2
1010
18e2e3fd7d82d239ab24807fcc1033094ea09940
11+
# Change Python target-version to 3.10
12+
d5cda436e48d4eb773b1b165726556fe6a8db490

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Steps to reproduce the behavior, preferably code snippet.
1717
A clear and concise description of what you expected to happen.
1818

1919
**System (please complete the following information):**
20-
- Python version: [e.g. 3.10]
21-
- darts version [e.g. 0.31.0]
20+
- Python version: [e.g. 3.11]
21+
- darts version [e.g. 0.38.0]
2222

2323
**Additional context**
2424
Add any other context about the problem here.

.github/scripts/libomp-macOS.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
brew install libomp
2+
3+
# libomp is installed keg-only and is not symlinked into the default Homebrew
4+
# prefix, so neither LightGBM, PyTorch, ... will find it automatically. All
5+
# libraries bundle their own libomp.dylib; when two OpenMP runtimes are loaded
6+
# in the same process on macOS ARM64 the dynamic linker deadlocks.
7+
#
8+
# DYLD_LIBRARY_PATH: makes macOS resolve "libomp.dylib" to the single shared
9+
# Homebrew copy before the per-wheel bundled copies, so only one runtime is
10+
# loaded at all.
11+
LIBOMP_LIB="$(brew --prefix libomp)/lib"
12+
echo "DYLD_LIBRARY_PATH=${LIBOMP_LIB}:${DYLD_LIBRARY_PATH}" >> "$GITHUB_ENV"

.github/workflows/develop.yml

Lines changed: 68 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -10,132 +10,122 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: "Clone repository"
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v6
1414

15-
- name: "Set up Python 3.10"
16-
uses: actions/setup-python@v5
15+
- name: "Set up Python 3.11"
16+
uses: actions/setup-python@v6
1717
with:
18-
python-version: '3.10'
18+
python-version: '3.11'
19+
20+
- name: "Install uv"
21+
uses: astral-sh/setup-uv@v8.1.0
22+
with:
23+
version: "0.11.7"
24+
python-version: '3.11'
1925

2026
- name: "Install Dev Dependencies"
2127
run: |
22-
python -m pip install --upgrade pip
23-
pip install -r requirements/dev.txt
28+
# Testing against latest compatible versions
29+
uv sync --group dev
2430
2531
- name: "Lint"
2632
run: |
27-
pre-commit run --all-files
28-
33+
uv run pre-commit run --all-files
2934
3035
tests:
3136
runs-on: ${{ matrix.os }}
3237
strategy:
3338
matrix:
3439
os: [macos-14, ubuntu-latest]
35-
python-version: ['3.10']
40+
python-version: ['3.11']
3641
flavour: ['all']
3742

3843
steps:
3944
- name: "Clone repository"
40-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
4146

4247
- name: "Set up Python ${{ matrix.python-version }}"
43-
uses: actions/setup-python@v5
48+
uses: actions/setup-python@v6
4449
with:
4550
python-version: ${{ matrix.python-version }}
4651

47-
# use `uv` to retrieve the latest dependency versions
48-
- name: "Compile Dependency Versions"
49-
run: |
50-
curl -LsSf https://astral.sh/uv/install.sh | sh
51-
uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
52-
53-
- name: "Cache python environment"
54-
uses: actions/cache@v4
55-
id: pythonenv-cache
52+
- name: "Install uv"
53+
uses: astral-sh/setup-uv@v8.1.0
5654
with:
57-
path: ${{ env.pythonLocation }}
58-
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
59-
60-
- name: "Setup Pip"
61-
run: |
62-
python -m pip install --upgrade pip
55+
version: "0.11.7"
56+
enable-cache: true
57+
python-version: ${{ matrix.python-version }}
6358

6459
- name: "Install Dependencies"
6560
run: |
66-
# install latest dependencies (potentially updating cached dependencies)
67-
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
61+
# Testing against latest compatible versions
62+
# dev-all group includes everything: dev, optional, release, torch, notorch
63+
# --group torch-cpu uses CPU-only PyTorch from the configured index
64+
uv sync --group dev-all --group torch-cpu
6865
6966
- name: "Install libomp (for LightGBM)"
7067
run: |
7168
chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
7269
./.github/scripts/libomp-${{ runner.os }}.sh
7370
74-
- name: "Install Darts Locally"
75-
run: |
76-
pip install .
77-
7871
- name: "Run tests"
7972
run: |
80-
pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
73+
uv run pytest --durations=50 --timeout=900 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
8174
8275
- name: "Codecov upload"
8376
if: ${{ matrix.flavour == 'all' }}
84-
uses: codecov/codecov-action@v4
77+
uses: codecov/codecov-action@v6
8578
with:
8679
fail_ci_if_error: true
8780
token: ${{ secrets.CODECOV_TOKEN }}
8881

82+
- name: "Optimize cache for CI"
83+
run: |
84+
# Remove pre-built wheels but keep source-built wheels
85+
# This reduces cache size while retaining expensive-to-rebuild packages
86+
uv cache prune --ci
87+
8988
docs:
9089
runs-on: ubuntu-latest
9190
steps:
9291
- name: "Clone repository"
93-
uses: actions/checkout@v4
92+
uses: actions/checkout@v6
9493

95-
- name: "Set up Python 3.10"
96-
uses: actions/setup-python@v5
94+
- name: "Set up Python 3.11"
95+
uses: actions/setup-python@v6
9796
with:
98-
python-version: '3.10'
99-
100-
# use `uv` to retrieve the latest dependency versions
101-
- name: "Compile Dependency Versions"
102-
run: |
103-
curl -LsSf https://astral.sh/uv/install.sh | sh
104-
uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
97+
python-version: '3.11'
10598

106-
# only restore cache but do not upload
107-
- name: "Restore cached python environment"
108-
uses: actions/cache/restore@v4
109-
id: pythonenv-cache
99+
- name: "Install uv"
100+
uses: astral-sh/setup-uv@v8.1.0
110101
with:
111-
path: ${{ env.pythonLocation }}
112-
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
102+
version: "0.11.7"
103+
enable-cache: true
104+
python-version: '3.11'
113105

114106
- name: "Install pandoc"
115107
run: |
116108
sudo apt-get install -y pandoc
117109
118-
- name: "Setup Pip"
119-
run: |
120-
python -m pip install --upgrade pip
121-
122110
- name: "Install Dependencies"
123111
run: |
124-
# install latest dependencies (potentially updating cached dependencies)
125-
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
112+
# Testing against latest compatible versions
113+
uv sync --group dev-all --group torch-cpu
126114
127115
- name: "Install libomp (for LightGBM)"
128116
run: |
129117
chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
130118
./.github/scripts/libomp-${{ runner.os }}.sh
131119
132-
- name: "Install Darts Locally"
120+
- name: "Build docs"
133121
run: |
134-
pip install .
122+
uv run make --directory ./docs build-all-docs
135123
136-
- name: "Build docs"
124+
- name: "Optimize cache for CI"
137125
run: |
138-
make --directory ./docs build-all-docs
126+
# Remove pre-built wheels but keep source-built wheels
127+
# This reduces cache size while retaining expensive-to-rebuild packages
128+
uv cache prune --ci
139129
140130
check-examples:
141131
runs-on: ubuntu-latest
@@ -144,46 +134,37 @@ jobs:
144134
example-name: [03-FFT-examples.ipynb, 04-RNN-examples.ipynb, 00-quickstart.ipynb, 02-data-processing.ipynb, 01-multi-time-series-and-covariates.ipynb]
145135
steps:
146136
- name: "Clone repository"
147-
uses: actions/checkout@v4
137+
uses: actions/checkout@v6
148138

149-
- name: "Set up Python 3.10"
150-
uses: actions/setup-python@v5
139+
- name: "Set up Python 3.11"
140+
uses: actions/setup-python@v6
151141
with:
152-
python-version: '3.10'
153-
154-
# use `uv` to retrieve the latest dependency versions
155-
- name: "Compile Dependency Versions"
156-
run: |
157-
curl -LsSf https://astral.sh/uv/install.sh | sh
158-
uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
142+
python-version: '3.11'
159143

160-
# only restore cache but do not upload
161-
- name: "Restore cached python environment"
162-
uses: actions/cache/restore@v4
163-
id: pythonenv-cache
144+
- name: "Install uv"
145+
uses: astral-sh/setup-uv@v8.1.0
164146
with:
165-
path: ${{ env.pythonLocation }}
166-
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
167-
168-
- name: "Setup Pip"
169-
run: |
170-
python -m pip install --upgrade pip
147+
version: "0.11.7"
148+
enable-cache: true
149+
python-version: '3.11'
171150

172151
- name: "Install Dependencies"
173152
run: |
174-
# install latest dependencies (potentially updating cached dependencies)
175-
pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
153+
# Testing against latest compatible versions
154+
uv sync --group dev-all --group torch-cpu
176155
177156
- name: "Install libomp (for LightGBM)"
178157
run: |
179158
chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
180159
./.github/scripts/libomp-${{ runner.os }}.sh
181160
182-
- name: "Install Darts Locally"
183-
run: |
184-
pip install .
185-
186161
- name: "Run example ${{matrix.example-name}}"
187162
working-directory: ./examples
188163
run: |
189-
papermill ${{matrix.example-name}} ${{matrix.example-name}}
164+
uv run papermill ${{matrix.example-name}} ${{matrix.example-name}}
165+
166+
- name: "Optimize cache for CI"
167+
run: |
168+
# Remove pre-built wheels but keep source-built wheels
169+
# This reduces cache size while retaining expensive-to-rebuild packages
170+
uv cache prune --ci

0 commit comments

Comments
 (0)