Skip to content

Commit 5e8eca9

Browse files
authored
Merge pull request #333 from unit8co/develop
v0.8.0
2 parents 160ae4b + f13c88a commit 5e8eca9

File tree

79 files changed

+47517
-50917
lines changed

Some content is hidden

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

79 files changed

+47517
-50917
lines changed

.github/workflows/develop.yml

+46-7
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,31 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

26-
- name: "3. Setup pip"
26+
# downloading gradle multiple times in parallel can yield to connection errors
27+
- name: "3. Cache gradle distribution"
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.gradle/wrapper/dists
31+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
32+
33+
- name: "3.1 Cache gradle packages"
34+
uses: actions/cache@v2
35+
with:
36+
path: ~/.gradle/caches
37+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
38+
39+
- name: "4. Setup pip"
2740
run: |
2841
./gradlew setupPip
2942
30-
- name: "4. Attach cache for pip"
43+
- name: "5. Attach cache for pip"
3144
uses: actions/cache@v1
3245
id: cache
3346
with:
3447
path: ~/.cache/pip
3548
key: tests-${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements/core.txt', 'requirements/dev.txt', 'requirements/fbprophet.txt', 'requirements/pmdarima.txt', 'requirements/torch.txt') }}
3649

37-
- name: "5. Tests"
50+
- name: "6. Tests"
3851
run: |
3952
./gradlew "test_${{matrix.flavour}}"
4053
@@ -53,18 +66,31 @@ jobs:
5366
run: |
5467
sudo apt-get install -y pandoc
5568
56-
- name: "4. Setup pip"
69+
# downloading gradle multiple times in parallel can yield to connection errors
70+
- name: "4. Cache gradle distribution"
71+
uses: actions/cache@v2
72+
with:
73+
path: ~/.gradle/wrapper/dists
74+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
75+
76+
- name: "4.1 Cache gradle packages"
77+
uses: actions/cache@v2
78+
with:
79+
path: ~/.gradle/caches
80+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
81+
82+
- name: "5. Setup pip"
5783
run: |
5884
./gradlew setupPip
5985
60-
- name: "5. Attach cache for pip"
86+
- name: "6. Attach cache for pip"
6187
uses: actions/cache@v1
6288
id: cache
6389
with:
6490
path: ~/.cache/pip
6591
key: tests-${{ runner.os }}-3.8-pip-${{ hashFiles('requirements/core.txt', 'requirements/release.txt') }}
6692

67-
- name: "6. Build docs"
93+
- name: "7. Build docs"
6894
run: |
6995
./gradlew buildDocs
7096
@@ -82,7 +108,20 @@ jobs:
82108
with:
83109
python-version: 3.8
84110

85-
- name: "3. Run examples ${{matrix.example-name}}"
111+
# downloading gradle multiple times in parallel can yield to connection errors
112+
- name: "3. Cache gradle distribution"
113+
uses: actions/cache@v2
114+
with:
115+
path: ~/.gradle/wrapper/dists
116+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
117+
118+
- name: "3.1 Cache gradle packages"
119+
uses: actions/cache@v2
120+
with:
121+
path: ~/.gradle/caches
122+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
123+
124+
- name: "4. Run examples ${{matrix.example-name}}"
86125
run: |
87126
./gradlew checkExample -PexampleName=${{matrix.example-name}}
88127

.github/workflows/merge.yml

+46-7
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,31 @@ jobs:
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626

27-
- name: "3. Setup pip"
27+
# downloading gradle multiple times in parallel can yield to connection errors
28+
- name: "3. Cache gradle distribution"
29+
uses: actions/cache@v2
30+
with:
31+
path: ~/.gradle/wrapper/dists
32+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
33+
34+
- name: "3.1 Cache gradle packages"
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.gradle/caches
38+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
39+
40+
- name: "4. Setup pip"
2841
run: |
2942
./gradlew setupPip
3043
31-
- name: "4. Attach cache for pip"
44+
- name: "5. Attach cache for pip"
3245
uses: actions/cache@v1
3346
id: cache
3447
with:
3548
path: ~/.cache/pip
3649
key: tests-${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements/core.txt', 'requirements/dev.txt', 'requirements/fbprophet.txt', 'requirements/pmdarima.txt', 'requirements/torch.txt') }}
3750

38-
- name: "5. Tests"
51+
- name: "6. Tests"
3952
run: |
4053
./gradlew "test_${{matrix.flavour}}"
4154
@@ -53,7 +66,20 @@ jobs:
5366
with:
5467
python-version: 3.8
5568

56-
- name: "3. Run examples ${{matrix.example-name}}"
69+
# downloading gradle multiple times in parallel can yield to connection errors
70+
- name: "3. Cache gradle distribution"
71+
uses: actions/cache@v2
72+
with:
73+
path: ~/.gradle/wrapper/dists
74+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
75+
76+
- name: "3.1 Cache gradle packages"
77+
uses: actions/cache@v2
78+
with:
79+
path: ~/.gradle/caches
80+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
81+
82+
- name: "4. Run examples ${{matrix.example-name}}"
5783
run: |
5884
./gradlew checkExample -PexampleName=${{matrix.example-name}}
5985
@@ -73,17 +99,30 @@ jobs:
7399
run: |
74100
sudo apt-get install -y pandoc
75101
76-
- name: "4. Setup pip"
102+
# downloading gradle multiple times in parallel can yield to connection errors
103+
- name: "4. Cache gradle distribution"
104+
uses: actions/cache@v2
105+
with:
106+
path: ~/.gradle/wrapper/dists
107+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
108+
109+
- name: "4.1 Cache gradle packages"
110+
uses: actions/cache@v2
111+
with:
112+
path: ~/.gradle/caches
113+
key: tests-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
114+
115+
- name: "5. Setup pip"
77116
run: |
78117
./gradlew setupPip
79118
80-
- name: "5. Attach cache for pip"
119+
- name: "6. Attach cache for pip"
81120
uses: actions/cache@v1
82121
id: cache
83122
with:
84123
path: ~/.cache/pip
85124
key: release-${{ runner.os }}-3.8-pip-${{ hashFiles('requirements/core.txt', 'requirements/release.txt') }}
86125

87-
- name: "6. Build docs"
126+
- name: "7. Build docs"
88127
run: |
89128
./gradlew buildDocs

.github/workflows/release.yml

+32-6
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,25 @@ jobs:
9797
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
9898
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
9999

100+
# downloading gradle multiple times in parallel can yield to connection errors
101+
- name: "4. Cache gradle distribution"
102+
uses: actions/cache@v2
103+
with:
104+
path: ~/.gradle/wrapper/dists
105+
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
106+
107+
- name: "4.1 Cache gradle packages"
108+
uses: actions/cache@v2
109+
with:
110+
path: ~/.gradle/caches
111+
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
112+
100113
#check build.gradle file for explanation of next steps
101-
- name: "4. Publish image with tag corresponding to current version"
114+
- name: "5. Publish image with tag corresponding to current version"
102115
run: |
103116
./gradlew dockerPushVersion -P version=${{ steps.bump_dry.outputs.tag }}
104117
105-
- name: "5. Publish image with tag 'latest' if not hotfix"
118+
- name: "6. Publish image with tag 'latest' if not hotfix"
106119
if: ${{ !contains(github.event.head_commit.message, '#hotfix') }}
107120
run: |
108121
./gradlew dockerPushLatest
@@ -124,11 +137,24 @@ jobs:
124137
run: |
125138
sudo apt-get install -y pandoc
126139
127-
- name: "4. Setup pip"
140+
# downloading gradle multiple times in parallel can yield to connection errors
141+
- name: "4. Cache gradle distribution"
142+
uses: actions/cache@v2
143+
with:
144+
path: ~/.gradle/wrapper/dists
145+
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
146+
147+
- name: "4.1 Cache gradle packages"
148+
uses: actions/cache@v2
149+
with:
150+
path: ~/.gradle/caches
151+
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
152+
153+
- name: "5. Setup pip"
128154
run: |
129155
./gradlew setupPip
130156
131-
- name: "5. Attach cache for pip"
157+
- name: "6. Attach cache for pip"
132158
uses: actions/cache@v1
133159
id: cache
134160
with:
@@ -137,11 +163,11 @@ jobs:
137163
restore-keys: |
138164
release-${{ runner.os }}-pip-
139165
140-
- name: "6. Build docs"
166+
- name: "7. Build docs"
141167
run: |
142168
./gradlew buildDocs
143169
144-
- name: "7. Publish documentation to gh-pages"
170+
- name: "8. Publish documentation to gh-pages"
145171
146172
env:
147173
REPO: self

CHANGELOG.md

+46-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,53 @@
1+
12
# Changelog
23

34
Darts is still in an early development phase and we cannot always guarantee backwards compatibility. Changes that may **break code which uses a previous release of Darts** are marked with a "🔴".
45

56
## [Unreleased](https://github.com/unit8co/darts/tree/develop)
6-
77
[Full Changelog](https://github.com/unit8co/darts/compare/0.7.0...develop)
88

99

10+
## [0.8.0](https://github.com/unit8co/darts/tree/0.8.0) (2021-05-21)
11+
12+
### For users of the library:
13+
**Added:**
14+
- `RandomForest` algorithm implemented. Uses the scikit-learn `RandomForestRegressor` to predict future values from (lagged) exogenous
15+
variables and lagged values of the target.
16+
- `darts.datasets` is a new submodule allowing to easily download, cache and import some commonly used time series.
17+
E.g. doing
18+
```
19+
from darts.datasets import AirPassengers
20+
ts: TimeSeries = AirPassengers.load()
21+
```
22+
- Better support for processing sequences of `TimeSeries`.
23+
* The Transformers, Pipelines and metrics have been adapted to be used on sequences of `TimeSeries`
24+
(rather than isolated series).
25+
* The inference of neural networks on sequences of series has been improved
26+
- There is a new utils function `darts.utils.model_selection.train_test_split` which allows to split a `TimeSeries`
27+
or a sequence of `TimeSeries` into train and test sets; either along the sample axis or along the time axis.
28+
It also optionally allows to do "model-aware" splitting, where the split reclaims as much data as possible for the
29+
training set.
30+
- Our implementation of N-BEATS, `NBEATSModel`, now supports multivariate time series, as well as covariates.
31+
32+
**Changed**
33+
- `RegressionModel` is now a user exposed class. It acts as a wrapper around any regression model with a `fit()` and `predict()`
34+
method. It enables the flexible usage of lagged values of the target variable as well as lagged values of multiple exogenous
35+
variables. Allowed values for the `lags` argument are positive integers or a list of positive integers indicating which lags
36+
should be used during training and prediction, e.g. `lags=12` translates to training with the last 12 lagged values of the target variable.
37+
`lags=[1, 4, 8, 12]` translates to training with the previous value, the value at lag 4, lag 8 and lag 12.
38+
- 🔴 `StandardRegressionModel` is now called `LinearRegressionModel`. It implements a linear regression model
39+
from `sklearn.linear_model.LinearRegression`. Users who still need to use the former `StandardRegressionModel` with
40+
another sklearn model should use the `RegressionModel` now.
41+
42+
**Fixed**
43+
- We have fixed a bug arising when multiple scalers were used.
44+
- We have fixed a small issue in the TCN architecture, which makes our implementation follow the original paper
45+
more closely.
46+
47+
### For developers of the library:
48+
**Added:**
49+
- We have added some [contribution guidelines](https://github.com/unit8co/darts/blob/develop/CONTRIBUTE.md).
50+
1051
## [0.7.0](https://github.com/unit8co/darts/tree/0.7.0) (2021-04-14)
1152

1253
[Full Changelog](https://github.com/unit8co/darts/compare/0.6.0...0.7.0)
@@ -16,10 +57,10 @@ Darts is still in an early development phase and we cannot always guarantee back
1657
- `darts` Pypi package. It is now possible to `pip install darts`. The older name `u8darts` is still maintained
1758
and provides the different flavours for lighter installs.
1859
- New forecasting model available: VARIMA (Vector Autoregressive moving average).
19-
- Support for exogeneous variables in ARIMA, AutoARIMA and VARIMA (optional `exog` parameter in `fit()` and `predict()`
60+
- Support for exogeneous variables in ARIMA, AutoARIMA and VARIMA (optional `exog` parameter in `fit()` and `predict()`
2061
methods).
2162
- New argument `dummy_index` for `TimeSeries` creation. If a series is just composed of a sequence of numbers
22-
without timestamps, setting this flag will allow to create a `TimeSeries` which uses a "dummy time index" behind the
63+
without timestamps, setting this flag will allow to create a `TimeSeries` which uses a "dummy time index" behind the
2364
scenes. This simplifies the creation of `TimeSeries` in such cases, and makes it possible to use all forecasting models,
2465
except those that explicitly rely on dates.
2566
- New method `TimeSeries.diff()` returning differenced `TimeSeries`.
@@ -59,7 +100,7 @@ several time series.
59100
- An implementation `SimpleInferenceDataset` of `TimeSeriesInferenceDataset`.
60101
- All PyTorch models have a new `fit_from_dataset()` method which allows to directly fit the model from a specified
61102
`TrainingDataset` instance (instead of using a default instance when going via the `fit()` method).
62-
- A new explanatory notebooks for global models:
103+
- A new explanatory notebooks for global models:
63104
https://github.com/unit8co/darts/blob/master/examples/02-multi-time-series-and-covariates.ipynb
64105

65106
**Changed:**
@@ -232,4 +273,4 @@ All implementations of `GlobalForecastingModel`s support multivariate time serie
232273

233274
## Older releases
234275

235-
[Full Changelog](https://github.com/unit8co/darts/compare/f618c4536bf7ed6e3b6a2239fbca4e3089736426...0.2.3)
276+
[Full Changelog](https://github.com/unit8co/darts/compare/f618c4536bf7ed6e3b6a2239fbca4e3089736426...0.2.3)

CONTRIBUTE.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Darts Contribution Guidelines
2+
3+
## Main Development Principles
4+
5+
* Focus on simplicity and clarity for end users.
6+
* Pay attention to designing the best possible API, simple by default, but offering control when needed.
7+
* Make it hard for users to make mistakes (e.g., future data leakage).
8+
* `TimeSeries` is the main data type used to interface with Darts because:
9+
* We do not want users to have to worry about the specifics of Numpy, Torch etc
10+
(users shouldn’t have to know what’s used behind the scenes if they don’t want to).
11+
* `TimeSeries` objects provide guarantees that the data represent a well-formed time series.
12+
* It is in general OK to propose breaking changes, if these changes are really genuinely improving the API.
13+
* Embrace functional principles as much as possible (immutability, using pure functions).
14+
* Coding style: better write clear code than fancy code. Follow PEP-8. Use type hints.
15+
* Write good docstrings for public classes and methods.
16+
* Always unit test everything.
17+
18+
#### These principles should prevail even if:
19+
* They mean more code has to be written inside the library.
20+
* They decrease the raw performance / computational speed.
21+
22+
23+
24+
## Technical Procedure
25+
26+
Before working on a contribution (a new feature or a fix) make sure you can't find anything
27+
related in [issues](https://github.com/unit8co/darts/issues).
28+
If there is no on-going effort on what you plan to do then we recommend to do the following:
29+
30+
1. Create an issue, describe how you would attempt to solve it, and if possible wait for a discussion.
31+
2. Fork the repository.
32+
3. Clone the forked repository locally.
33+
4. Create a clean Python env and install requirements with pip: `pip install -r requirements/dev-all.txt`
34+
5. Create a new branch:
35+
* Branch off from the **develop** branch.
36+
* Prefix the branch with the type of update you are making:
37+
* `feature/`
38+
* `fix/`
39+
* `refactor/`
40+
*
41+
* Work on your update
42+
6. Check that your code passes all the tests and design new unit tests if needed: `./gradlew unitTest_all`.
43+
7. Verify your tests coverage by running `./gradlew coverageTest`
44+
* Additionally you can generate an xml report and use VSCode Coverage gutter to identify untested
45+
lines with `./coverage.sh xml`
46+
8. If your contribution introduces a significant change, add it to `CHANGELOG.md` under the "Unreleased" section.
47+
9. Create a pull request from your new branch into the **develop** branch.

0 commit comments

Comments
 (0)