diff --git a/darts/ad/detectors/threshold_detector.py b/darts/ad/detectors/threshold_detector.py index 7a0eac4324..1d89d90a99 100644 --- a/darts/ad/detectors/threshold_detector.py +++ b/darts/ad/detectors/threshold_detector.py @@ -80,8 +80,8 @@ def _detect_core(self, series: TimeSeries, name: str = "series") -> TimeSeries: def _detect_fn(x, lo, hi): # x of shape (time,) for 1 component - return (x < (np.NINF if lo is None else lo)) | ( - x > (np.Inf if hi is None else hi) + return (x < (-np.inf if lo is None else lo)) | ( + x > (np.inf if hi is None else hi) ) detected = np.zeros_like(np_series, dtype=int) diff --git a/darts/models/forecasting/fft.py b/darts/models/forecasting/fft.py index 35d2f67583..2143c917c5 100644 --- a/darts/models/forecasting/fft.py +++ b/darts/models/forecasting/fft.py @@ -356,7 +356,7 @@ def fit(self, series: TimeSeries): ] # set all other values in the frequency domain to 0 - self.fft_values_filtered = np.zeros(len(self.fft_values), dtype=np.complex_) + self.fft_values_filtered = np.zeros(len(self.fft_values), dtype=np.complex128) self.fft_values_filtered[self.filtered_indices] = self.fft_values[ self.filtered_indices ] diff --git a/darts/models/forecasting/forecasting_model.py b/darts/models/forecasting/forecasting_model.py index dfcbe9de13..c191fd1e3d 100644 --- a/darts/models/forecasting/forecasting_model.py +++ b/darts/models/forecasting/forecasting_model.py @@ -1120,7 +1120,7 @@ def retrain_func( length=1, freq=series_.freq, ), - values=np.array([np.NaN]), + values=np.array([np.nan]), ) forecast = model._predict_wrapper( diff --git a/darts/utils/losses.py b/darts/utils/losses.py index 2c51e71145..948660e791 100644 --- a/darts/utils/losses.py +++ b/darts/utils/losses.py @@ -17,7 +17,7 @@ def _divide_no_nan(a, b): result = a / b result[result != result] = 0.0 result[result == np.inf] = 0.0 - result[result == np.NINF] = 0.0 + result[result == -np.inf] = 0.0 return result