SpikeInterface / MEArec

Fast and customizable of extracellular recordings on MEA
GNU General Public License v3.0
42 stars 19 forks source link

`np.float` is not allowed in latest numpy version #160

Closed LuighiV closed 1 year ago

LuighiV commented 1 year ago

When running with latest version of numpy==1.25.1, it is getting an error regarding the type validation for np.float

File /env/lib/python3.11/site-packages/MEArec/tools.py:649, in recursively_save_dict_contents_to_group(h5file, path, dic)
    636 """
    637 Save dictionary recursively  to h5 file (helper function).
    638 
   (...)
    646     Path to the h5 field
    647 """
    648 for key, item in dic.items():
--> 649     if isinstance(item, (int, float, np.integer, np.float, str, bytes, np.bool_)):
    650         if isinstance(item, np.str_):
    651             item = str(item)

File /env/lib/python3.11/site-packages/numpy/__init__.py:313, in __getattr__(attr)
    308     warnings.warn(
    309         f"In the future `np.{attr}` will be defined as the "
    310         "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    312 if attr in __former_attrs__:
--> 313     raise AttributeError(__former_attrs__[attr])
    315 if attr == 'testing':
    316     import numpy.testing as testing

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

Please, consider changing it to np.float64.

LuighiV commented 1 year ago

Looks like I was using an outdated version, and the fix was added in cfa9a1f Thanks!