-
Notifications
You must be signed in to change notification settings - Fork 43
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
np.str deprecated for numpy >= 1.24.0 - breaks MDSplus python #2532
Comments
I have tried this with the current alpha, and looked at the source of the current stable. It works with the current alpha:
TCL> show version
MDSplus version: 7.139.17
----------------------
Release: alpha_release_7.139.17
Browse: https://github.com/MDSplus/mdsplus/tree/alpha_release_7.139.17
Download: https://github.com/MDSplus/mdsplus/archive/alpha_release_7.139.17.tar.gz
TCL> exit
***@***.***:~$ python
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> import numpy as np
>> np.__version__
'1.21.5'
>> import MDSplus
>> MDSplus.String('now is the time')
'now is the time'
>>
I looked at the current stable, and I don’t see any code which would trigger this error. What version are you running ?
-Josh
… On Feb 10, 2023, at 7:06 AM, Cenk Yildiz ***@***.***> wrote:
Hello,
I can overcome this by downgrading numpy to 1.19.5, but wanted to bring them to your attention for the future.
OS: RHEL8 compatible systems (rocky8, alma8)
MDS versions: both alpha and stable
python version: python3.9
numpy versions: (tested 1.19.5, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0)
no.str is deprecated (Used in mdsscalar.py - class String)
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
>>> import MDSplus
>>> MDSplus.String("ads")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/mdsplus/python/MDSplus/mdsscalar.py", line 422, in __init__
if not isinstance(self._value, _N.str):
File "/home/yildiz/myenv/lib64/python3.9/site-packages/numpy/__init__.py", line 305, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'str'.
`np.str` was a deprecated alias for the builtin `str`. To avoid this error in existing code, use `str` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
—
Reply to this email directly, view it on GitHub <#2532>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABY5AZPSXF7ULKAHZDKJPBDWWYVMVANCNFSM6AAAAAAUXXAZO4>.
You are receiving this because you are subscribed to this thread.
|
MDSplus alpha 7.139.20 My post was unclear, sorry. Deprecation message appeared in numpy 1.20, but it's only truly deprecated in 1.24.
Out of these, only 1.24.0 fails, rest of them work fine. If you create a new virtualenv and install numpy, you should get the latest version (1.24.2) and hit this issue
|
Hello Cenk, Yes, I'm able to reproduce the issue. |
Hello,
I can overcome this by downgrading numpy to 1.19.5, but wanted to bring them to your attention for the future.
OS: RHEL8 compatible systems (rocky8, alma8)
MDS versions: both alpha and stable
python version: python3.9
numpy versions: (tested 1.19.5, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0)
no.str is deprecated (Used in mdsscalar.py - class String)
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
The text was updated successfully, but these errors were encountered: