Skip to content

fix np.float#3

Open
jdanz-psfc wants to merge 1 commit intoMDSplus:developfrom
jdanz-psfc:fix-np
Open

fix np.float#3
jdanz-psfc wants to merge 1 commit intoMDSplus:developfrom
jdanz-psfc:fix-np

Conversation

@jdanz-psfc
Copy link

@jdanz-psfc jdanz-psfc commented May 16, 2023

Before this change, we get the following error on modern NumPy versions:

Traceback (most recent call last):
  File "/usr/local/mdsplus/tdi/dev_support/MDSDEVICES.py", line 69, in MDSDEVICES
    ans += importDevices(module)
  File "/usr/local/mdsplus/tdi/dev_support/MDSDEVICES.py", line 40, in importDevices
    module = __import__(name)
  File "/usr/local/mdsplus/pydevices/RfxDevices/__init__.py", line 67, in <module>
    _mimport(filename[:-3])
  File "/usr/local/mdsplus/pydevices/RfxDevices/__init__.py", line 42, in _mimport
    module = __import__(name, globals(), level=level)
  File "/usr/local/mdsplus/pydevices/RfxDevices/MARTE2_PYTHON_PID.py", line 29, in <module>
    import pid
  File "/opt/MARTe2/MARTe2-MDSplus/GAMs/PyGAM/pid.py", line 31, in <module>
    y_1 = np.float(0.)
  File "/home/jdanz/.local/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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

This commit resolves that error.

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

Successfully merging this pull request may close these issues.

1 participant