Skip to content
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

Deprecation warnings when running the hello world example #80

Closed
gassmoeller opened this issue Nov 14, 2024 · 3 comments
Closed

Deprecation warnings when running the hello world example #80

gassmoeller opened this issue Nov 14, 2024 · 3 comments

Comments

@gassmoeller
Copy link
Contributor

When I run the hello world example as described here the simulation finishes without error, but produces a number of warnings during the runtime. I followed the installation for the source code installation here to install pyopmspe11.

This doesnt seem to affect the result, I just wanted to document the warning.

Displayed warning (excerpt from the screen output):

python3 /home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/src/pyopmspe11/visualization/data.py -p spe11b -d spe11b -g all -r 50,1,15 -t 5 -w 1.0 -u resdata
The Python package opm was not found, using resdata
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:873: DeprecationWarning: The method the [] operator will change behaviour in the future. It will then return a plain numpy vector. You are advised to change to use the numpy_vector() method right away
  warnings.warn(
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:407: DeprecationWarning: The method get_vector() has been deprecated, use numpy_vector() instead
  warnings.warn(
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:873: DeprecationWarning: The method the [] operator will change behaviour in the future. It will then return a plain numpy vector. You are advised to change to use the numpy_vector() method right away
  warnings.warn(
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:407: DeprecationWarning: The method get_vector() has been deprecated, use numpy_vector() instead
  warnings.warn(
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:873: DeprecationWarning: The method the [] operator will change behaviour in the future. It will then return a plain numpy vector. You are advised to change to use the numpy_vector() method right away
  warnings.warn(
/home/rene/work/reviews/2024-joss-pyopmspe11/pyopmspe11/vpyopmspe11/lib/python3.12/site-packages/resdata/summary/rd_sum.py:407: DeprecationWarning: The method get_vector() has been deprecated, use numpy_vector() instead
  warnings.warn(
... ( a lot of repetitions of the same warning)

My environment:

Package                       Version     Editable project location
----------------------------- ----------- -------------------------------------------------------
alabaster                     1.0.0
astroid                       3.3.5
babel                         2.16.0
black                         24.10.0
certifi                       2024.8.30
charset-normalizer            3.4.0
click                         8.1.7
contourpy                     1.3.1
coverage                      7.6.4
cwrap                         1.6.7
cycler                        0.12.1
dill                          0.3.9
docutils                      0.21.2
fonttools                     4.54.1
idna                          3.10
imagesize                     1.4.1
iniconfig                     2.0.0
isort                         5.13.2
Jinja2                        3.1.4
kiwisolver                    1.4.7
Mako                          1.3.6
MarkupSafe                    3.0.2
matplotlib                    3.9.2
mccabe                        0.7.0
mypy                          1.13.0
mypy-extensions               1.0.0
numpy                         2.1.3
numpydoc                      1.8.0
packaging                     24.2
pandas                        2.2.3
pathspec                      0.12.1
pillow                        11.0.0
pip                           24.3.1
platformdirs                  4.3.6
pluggy                        1.5.0
pyarrow                       18.0.0
Pygments                      2.18.0
pylint                        3.3.1
pyopmspe11                    2024.4      [... path to my pyopmspe11]
pyparsing                     3.2.0
pytest                        8.3.3
pytest-cov                    6.0.0
python-dateutil               2.9.0.post0
pytz                          2024.2
requests                      2.32.3
resdata                       5.0.0
Rtree                         1.3.0
scipy                         1.14.1
setuptools                    75.5.0
shapely                       2.0.6
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        8.1.3
sphinx-rtd-theme              3.0.2
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jquery          4.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0
tabulate                      0.9.0
tomlkit                       0.13.2
typing_extensions             4.12.2
tzdata                        2024.2
urllib3                       2.2.3
wheel                         0.45.0
@gassmoeller
Copy link
Contributor Author

Related to openjournals/joss-reviews#7357

@daavid00
Copy link
Collaborator

daavid00 commented Dec 4, 2024

Thanks @gassmoeller for pointing this. This issue has been addressed in #93.
If the flag -s is set to 1 (0 by default), Python warnings are written. In the current verison, these warnings come from the resdata dependency.

@gassmoeller
Copy link
Contributor Author

Ok, as long as you know the warnings are harmless. Ideally you would of course solve the cause of the warnings (are you using a deprecated function or setting of resdata?). I would recommend to leave the warnings enabled for your CI and some sort of developer build, otherwise you may miss new warnings in the future. However, for now this is an acceptable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants