Skip to content

Commit ede5664

Browse files
authored
Bump dependency version ranges for numpy & lightning (#3226)
*Issue #, if available:* *Description of changes:* 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
1 parent 7668ce1 commit ede5664

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

requirements/requirements-pytorch.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
torch>=1.9,<3
2-
lightning>=2.2.2,<2.4
2+
lightning>=2.2.2,<2.5
33
# Capping `lightning` does not cap `pytorch_lightning`, so we cap manually
4-
pytorch_lightning>=2.2.2,<2.4
4+
pytorch_lightning>=2.2.2,<2.5
55
scipy~=1.10; python_version > "3.7.0"
66
scipy~=1.7.3; python_version <= "3.7.0"

requirements/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
numpy~=1.16
1+
numpy>=1.16,<2.2
22
pandas>=1.0,<3
33
pydantic>=1.7,<3
44
tqdm~=4.23

src/gluonts/dataset/pandas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import logging
1717
from dataclasses import dataclass, field, InitVar
18-
from typing import Any, Iterable, Optional, Type, Union, cast
18+
from typing import Any, Iterable, Optional, Type, Union
1919

2020
import numpy as np
2121
import pandas as pd
@@ -351,4 +351,4 @@ def is_uniform(index: pd.PeriodIndex) -> bool:
351351
False
352352
"""
353353

354-
return cast(bool, np.all(np.diff(index.asi8) == index.freq.n))
354+
return bool(np.all(np.diff(index.asi8) == index.freq.n))

src/gluonts/itertools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _location_for(self, idx, side="right") -> _SubIndex:
240240
else:
241241
local_idx = idx - self._offsets[part_no - 1]
242242

243-
return _SubIndex(part_no, local_idx)
243+
return _SubIndex(int(part_no), int(local_idx))
244244

245245
def __getitem__(self, idx):
246246
if isinstance(idx, slice):

src/gluonts/model/forecast_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _unpack(batched) -> Iterator:
5959
This assumes that arrays are wrapped in a nested structure of lists and
6060
tuples, and each array has the same shape::
6161
62-
>>> a = np.arange(5)
62+
>>> a = np.arange(5, dtype="O")
6363
>>> batched = [a, (a, [a, a, a])]
6464
>>> list(_unpack(batched))
6565
[[0, (0, [0, 0, 0])],

src/gluonts/mx/trainer/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def base_path() -> str:
227227
best_epoch_info = {
228228
"params_path": "{}-{}.params".format(base_path(), "init"),
229229
"epoch_no": -1,
230-
"score": np.Inf,
230+
"score": float("inf"),
231231
}
232232

233233
optimizer = mx.optimizer.Adam(

src/gluonts/mx/trainer/learning_rate_scheduler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ def should_update(self, metric: float) -> bool:
5050

5151
@dataclass
5252
class Min(Objective):
53-
best: float = np.Inf
53+
best: float = float("inf")
5454

5555
def should_update(self, metric: float) -> bool:
5656
return metric < self.best
5757

5858

5959
@dataclass
6060
class Max(Objective):
61-
best: float = -np.Inf
61+
best: float = -float("inf")
6262

6363
def should_update(self, metric: float) -> bool:
6464
return metric > self.best

0 commit comments

Comments
 (0)