Skip to content

[ENH] address numpy 2 deprecations #1764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fkiraly opened this issue Feb 6, 2025 · 10 comments · May be fixed by #1855
Open

[ENH] address numpy 2 deprecations #1764

fkiraly opened this issue Feb 6, 2025 · 10 comments · May be fixed by #1855
Labels
enhancement New feature or request maintenance Continuous integration, unit testing & package distribution

Comments

@fkiraly
Copy link
Collaborator

fkiraly commented Feb 6, 2025

Current test execution causes these warnings:

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

We should diagnose the source and address the deprecation - noting that code should work under numpy 1 as well as numpy 2.

@fkiraly fkiraly added enhancement New feature or request good first issue Good for newcomers maintenance Continuous integration, unit testing & package distribution labels Feb 6, 2025
@HarshvirSandhu
Copy link

@fkiraly I tried reproducing this by running all tests locally but did not get any warnings

Image

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 12, 2025

@HarshvirSandhu, what is your env?

@HarshvirSandhu
Copy link

@fkiraly I am running the tests on ubuntu on python version 3.11.11
I had setup the environment locally just a few days ago

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 19, 2025

Can you please print your env? For instance, you need to use the most recent numpy version.

@HarshvirSandhu
Copy link

I'm using numpy Version: 2.2.2

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 22, 2025

I mean, please run pip freeze and print that out.

@HarshvirSandhu
Copy link

Here's the output of pip freeze:

absl-py==2.1.0
accessible-pygments==0.0.5
aiohappyeyeballs==2.4.6
aiohttp==3.11.12
aiosignal==1.3.2
alabaster==1.0.0
alembic==1.14.1
astroid==3.3.8
asttokens==3.0.0
attrs==25.1.0
babel==2.17.0
backports.functools-lru-cache==2.0.0
beautifulsoup4==4.13.3
black==25.1.0
bleach==6.2.0
certifi==2025.1.31
cfgv==3.4.0
charset-normalizer==3.4.1
click==8.1.8
colorlog==6.9.0
comm==0.2.2
commonmark==0.9.1
contourpy==1.3.1
coverage==7.6.12
cpflows==0.1.2
cycler==0.12.1
debugpy==1.8.12
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.9
distlib==0.3.9
docutils==0.21.2
execnet==2.1.1
executing==2.2.0
fastjsonschema==2.21.1
filelock==3.17.0
fonttools==4.56.0
frozenlist==1.5.0
fsspec==2025.2.0
future==1.0.0
greenlet==3.1.1
grpcio==1.70.0
h5py==3.12.1
identify==2.6.7
idna==3.10
imagesize==1.4.1
iniconfig==2.0.0
invoke==2.2.0
ipykernel==6.29.5
ipython==8.32.0
ipywidgets==8.1.5
isort==6.0.0
jedi==0.19.2
Jinja2==3.1.5
joblib==1.4.2
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.13
kiwisolver==1.4.8
lightning==2.5.0.post0
lightning-utilities==0.12.0
Mako==1.3.9
Markdown==3.7
MarkupSafe==3.0.2
matplotlib==3.10.0
matplotlib-inline==0.1.7
mccabe==0.7.0
mistune==3.1.1
mpmath==1.3.0
multidict==6.1.0
mypy==1.15.0
mypy-extensions==1.0.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nbsphinx==0.9.6
nest-asyncio==1.6.0
networkx==3.4.2
nodeenv==1.9.1
numpy==2.2.2
nvidia-cublas-cu12==12.4.5.8
nvidia-cuda-cupti-cu12==12.4.127
nvidia-cuda-nvrtc-cu12==12.4.127
nvidia-cuda-runtime-cu12==12.4.127
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.2.1.3
nvidia-curand-cu12==10.3.5.147
nvidia-cusolver-cu12==11.6.1.9
nvidia-cusparse-cu12==12.3.1.170
nvidia-cusparselt-cu12==0.6.2
nvidia-nccl-cu12==2.21.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.4.127
optuna==4.2.1
optuna-integration==4.2.1
packaging==24.2
pandas==2.2.3
pandoc==2.4
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
patsy==1.0.1
pexpect==4.9.0
pillow==11.1.0
platformdirs==4.3.6
pluggy==1.5.0
plumbum==1.9.0
ply==3.11
pre_commit==4.1.0
prompt_toolkit==3.0.50
propcache==0.2.1
protobuf==5.29.3
psutil==6.1.1
ptyprocess==0.7.0
pure_eval==0.2.3
pyarrow==19.0.0
pydata-sphinx-theme==0.16.1
pydocstyle==6.3.0
Pygments==2.19.1
pylint==3.3.4
pyparsing==3.2.1
pytest==8.3.4
pytest-cov==6.0.0
pytest-dotenv==0.5.2
pytest-sugar==1.0.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
-e git+https://github.com/HarshvirSandhu/pytorch-forecasting.git@15df81309b5f4b39058899e3e02b46fc756e2841#egg=pytorch_forecasting
pytorch-lightning==2.5.0.post0
pytorch_optimizer==3.4.0
pytz==2025.1
PyYAML==6.0.2
pyzmq==26.2.1
recommonmark==0.7.1
referencing==0.36.2
requests==2.32.3
rpds-py==0.22.3
ruff==0.9.6
scikit-learn==1.6.1
scipy==1.15.1
seaborn==0.13.2
six==1.17.0
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==8.1.3
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
SQLAlchemy==2.0.38
stack-data==0.6.3
statsmodels==0.14.4
subprocess32==3.5.4
sympy==1.13.1
tensorboard==2.19.0
tensorboard-data-server==0.7.2
termcolor==2.5.0
threadpoolctl==3.5.0
tinycss2==1.4.0
tokenize_rt==6.1.0
tomlkit==0.13.2
torch==2.6.0
torchmetrics==1.6.1
torchvision==0.21.0
tornado==6.4.2
tqdm==4.67.1
traitlets==5.14.3
triton==3.2.0
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
virtualenv==20.29.2
wcwidth==0.2.13
webencodings==0.5.1
Werkzeug==3.1.3
widgetsnbextension==4.0.13
yarl==1.18.3

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 22, 2025

strange, this should result in the warning if you run all the tests.

How are you running the tests?

@HarshvirSandhu
Copy link

Running this command python -m pytest tests

@fkiraly
Copy link
Collaborator Author

fkiraly commented Feb 23, 2025

This is how a typical CI log looks like:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Continuous integration, unit testing & package distribution
Projects
None yet
2 participants