noahbenson / neuropythy

A neuroscience library for Python, intended to complement the existing nibabel library.
GNU Affero General Public License v3.0
115 stars 21 forks source link

NumPy >1.20 deprecation incompatibility #30

Closed hharveygit closed 1 year ago

hharveygit commented 1 year ago

Hi Noah,

I reinstalled neuropythy today via pip install neuropythy, using Python v3.8.16. The latest version of NumPy (1.24) was installed as dependency. When I tried to calculate Wang and Benson atlases: python -m neuropythy atlas sub_name, the code exited with:

AttributeError: module 'numpy' has no attribute 'int'. 'np.int' was a deprecated alias for the builtin 'int'. To avoid this error in existing code, use 'int' by itself. Doing this will not modify any behavior and is safe. When replacing 'np.int', you may wish to use e.g. 'np.int64' or 'np.int32' to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20;

I worked around this issue by rolling back NumPy in my venv to 1.19.5.

Posting in case others are experiencing this or if I'm doing something obviously wrong in installation. Thanks! -Harvey

noahbenson commented 1 year ago

Hi Harvey! Thanks so much for the bug report—I am just back from vacation so just seeing this, but I should be able to fix it (and push a new neuropythy version) within a day or so. The bug is straightforward. I'll post here when it's fixed.

noahbenson commented 1 year ago

This should now be fixed by commit e0e014af350029ab7e0bcf2949a9078a35e4c15b! If you install version 0.12.9 via pip, the error should go away. Please let me know if you still get it after this point! Thanks again!