Skip to content

Commit

Permalink
Backports for v0.16.0 (#3235)
Browse files Browse the repository at this point in the history
*Description of changes:* Backporting PRs
- #3228 
- #3232 
- #3233 


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.


**Please tag this pr with at least one of these labels to make our
release process faster:** BREAKING, new feature, bug fix, other change,
dev setup
  • Loading branch information
lostella authored Nov 7, 2024
1 parent 3d05d46 commit 8bc68e6
Show file tree
Hide file tree
Showing 27 changed files with 53 additions and 173 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

- name: Install dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install tools
run: pip install "ruff==0.2.2" "docformatter[tomli]==1.5.0"
- name: Ruff (Flake8)
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/mxnet_nightly.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
- uses: actions/checkout@v4
- name: Get tags
run: git fetch --tags origin
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -U pip
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/style_type_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install .
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/test_release_unix_nightly.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/test_release_win32_nightly.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/tests-nixtla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-nursery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 1
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -17,8 +17,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install MXNet (Linux)
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-prophet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -32,8 +32,7 @@ jobs:
libxml2-dev \
libcurl4-openssl-dev
Rscript -e 'install.packages(c("forecast", "nnfor", "hts"), repos="https://cloud.r-project.org")'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests-torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -21,10 +21,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install ".[arrow]" \
pip install ".[arrow,torch,shell]" \
-r requirements/requirements-test.txt \
-r requirements/requirements-extras-m-competitions.txt \
-r requirements/requirements-pytorch.txt
-r requirements/requirements-extras-m-competitions.txt
pip install --no-deps -r requirements/requirements-extras-cpflows.txt
- name: Test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-xgboost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ notedown
lxml~=5.1.0
pytest-runner~=2.11
recommonmark
sphinx~=4.0
sphinx~=5.0
docutils<=0.16
optuna~=2.10
furo==2022.6.4.1
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-extras-shell.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flask~=2.0
waitress~=2.1.2
flask~=3.0
waitress~=3.0.1
2 changes: 1 addition & 1 deletion src/gluonts/dataset/repository/_ercot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def generate_ercot_dataset(dataset_path: Path, dataset_writer: DatasetWriter):
df.ffill(inplace=True)
regions = [col for col in df.columns if col not in ["ds", "y"]]

freq = "1H"
freq = "1h"
prediction_length = 24

start = pd.Period(df["ds"][0], freq=freq)
Expand Down
6 changes: 3 additions & 3 deletions src/gluonts/dataset/repository/_gp_copula_2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GPCopulaDataset(NamedTuple):
# original dataset can be found at https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014#
num_series=370,
prediction_length=24,
freq="H",
freq="h",
rolling_evaluations=7,
max_target_dim=None,
),
Expand All @@ -73,7 +73,7 @@ class GPCopulaDataset(NamedTuple):
# note there are 963 in the original dataset from https://archive.ics.uci.edu/ml/datasets/PEMS-SF
num_series=963,
prediction_length=24,
freq="H",
freq="h",
rolling_evaluations=7,
max_target_dim=None,
),
Expand All @@ -82,7 +82,7 @@ class GPCopulaDataset(NamedTuple):
url=root + "solar_nips.tar.gz",
num_series=137,
prediction_length=24,
freq="H",
freq="h",
rolling_evaluations=7,
max_target_dim=None,
),
Expand Down
6 changes: 3 additions & 3 deletions src/gluonts/dataset/repository/_lstnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class LstnetDataset(NamedTuple):
prediction_length=24,
rolling_evaluations=7,
start_date="2012-01-01",
freq="1H",
freq="1h",
agg_freq=None,
),
"traffic": LstnetDataset(
Expand All @@ -105,7 +105,7 @@ class LstnetDataset(NamedTuple):
prediction_length=24,
rolling_evaluations=7,
start_date="2015-01-01",
freq="H",
freq="h",
agg_freq=None,
),
"solar-energy": LstnetDataset(
Expand All @@ -117,7 +117,7 @@ class LstnetDataset(NamedTuple):
rolling_evaluations=7,
start_date="2006-01-01",
freq="10min",
agg_freq="1H",
agg_freq="1h",
),
}

Expand Down
4 changes: 4 additions & 0 deletions src/gluonts/dataset/repository/_tsf_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,15 @@ def generate_forecasting_dataset(
def default_prediction_length_from_frequency(freq: str) -> int:
prediction_length_map = {
"T": 60,
"min": 60,
"H": 48,
"h": 48,
"D": 30,
"W-SUN": 8,
"M": 12,
"ME": 12,
"Y": 4,
"YE": 4,
}
try:
freq = to_offset(freq).name
Expand Down
Loading

0 comments on commit 8bc68e6

Please sign in to comment.