Skip to content
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

incompatibility with numpy version > 2.0 #143

Open
ricogendron opened this issue Oct 29, 2024 · 0 comments
Open

incompatibility with numpy version > 2.0 #143

ricogendron opened this issue Oct 29, 2024 · 0 comments

Comments

@ricogendron
Copy link

Recent numpy version >2.0 has a different behaviour compared to older ones, illustrated below.

With a recent numpy version:

In [4]: numpy.__version__
Out[4]: '2.0.2'

In [5]: numpy.any(None) != None
Out[5]: True

With older one:

In [11]: numpy.__version__
Out[11]: '1.21.5'

In [12]: numpy.any(None) != None
Out[12]: False

This change makes the soapy gui to crash, because of the many lines in soapy/soapy/gui/gui.py of this type :

   if numpy.any(plotDict["wfsFocalPlane"][wfs])!=None:

because now the code attempts to plot None in the graphics windows!

The issue can be solved by using instead this syntax below (as well as for 8 others similar lines in the functions update() and getPlotScaling() of gui.py) :

   if plotDict["wfsFocalPlane"][wfs] is not None:

This change will in turn preserve the compatibility with all numpy versions, older or recent.

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

No branches or pull requests

1 participant