cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
304 stars 155 forks source link

Update variable.py to. use np.bool_ rather than deprecated np.bool #1199

Closed zm711 closed 1 year ago

zm711 commented 1 year ago

NumPy versions >1.24 will no longer work with code including np.bool rather than issue a warning. So I just changed np.bool to np.bool_ which should work for new and older versions of NumPy.

aepadilla4 commented 1 year ago

Hi @zm711! I don't have much experience with python. Would it be possible for you to share the steps on how to update the variable? I am having this same issue.

zm711 commented 1 year ago

@aepadilla4 This fix would only work if you're doing this from source. If you're trying to do this with pip then #1193 explains two different ways that you can fix this issue. If you've already downloaded everything it might be easiest to just revert numpy to < 1.24 with pip3 install --upgrade numpy==1.23.1 or if you're using plain pip it would be pip install --upgrade numpy==1.23.1

aepadilla4 commented 1 year ago

@zm711 Thank you so much!

Datamance commented 1 year ago

1193 Linking my issue so I know when this closes

carsen-stringer commented 9 months ago

Can this update be included in a new pip release in the near future? Thanks! For now we will suggest that users pip install numpy==1.23.

zm711 commented 8 months ago

@carsen-stringer I don't know when there would be a new pypi release. There are a couple other features that are also missing from the current pip install (#1167 for example helps with users of linux). So if you have users that plan to use linux install from the .git might still be the better option until/if a new pypi release is made. (also as of this writing there is an issue with python 3.12)