Skip to content

incompatibility with numpy version > 2.0  #143

@ricogendron

Description

@ricogendron

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions