Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions pytorch_forecasting/data/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,26 @@
center = center.view(*center.size(), *(1,) * (y.ndim - center.ndim))
scale = scale.view(*scale.size(), *(1,) * (y.ndim - scale.ndim))

# coerce y to torch
if not isinstance(y, torch.Tensor):
if isinstance(y, (pd.Series, pd.DataFrame)):
y = y.values
y_was = "pandas"
y_was_dtype = y.dtype
else:
y_was = "numpy"
y = torch.as_tensor(y)
else:
y_was = "torch"

# transform
dtype = y.dtype
y = (y - center) / scale

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.10)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (macos-latest, 3.12)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (ubuntu-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.9)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.11)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

Check warning on line 728 in pytorch_forecasting/data/encoders.py

View workflow job for this annotation

GitHub Actions / no-softdeps (windows-latest, 3.13)

__array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)
try:
y = y.astype(dtype)
except AttributeError: # torch.Tensor has `.type()` instead of `.astype()`
y = y.type(dtype)

if y_was == "pandas":
y = pd.Series(y, dtype=y_was_dtype)
elif y_was == "numpy":
# coerce torch to numpy
y = y.numpy()

# return with center and scale or without
if return_norm:
Expand Down
Loading