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

Numpy2 removed numpy.sometrue. #2574

Closed
iandobbie opened this issue Jul 11, 2024 · 2 comments · Fixed by #2580
Closed

Numpy2 removed numpy.sometrue. #2574

iandobbie opened this issue Jul 11, 2024 · 2 comments · Fixed by #2580

Comments

@iandobbie
Copy link

Windows 10 22H2
'4.2.1 msw (phoenix) wxWidgets 3.2.2.1'
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32

I am not yet sure exactly the code path that is calling this but I will track down how to trigger this in a simple way but my application generates an exception. The core issue is in floatcanvas/FloatCanvas.py at line 604

    if N.sometrue(self.PanelSize <= 2 ):

numpy no longer has a numpy.sometrue() function

@iandobbie
Copy link
Author

If you just try to run Phoenix/samples/floatcanvas/MicroDemo.py you actually get two different numpy2 errors.

File ".../floatcanvas/lib/python3.12/site-packages/wx/lib/floatcanvas/FloatCanvas.py", line 782, in ZoomToBB
(BoundingBox[0,1]+BoundingBox[1,1])/2 ),N.float_)

Numpy.float_ has been removed from numpy2

and then

File ".../floatcanvas/lib/python3.12/site-packages/wx/lib/floatcanvas/FloatCanvas.py", line 604, in Draw
if N.sometrue(self.PanelSize <= 2 ):
^^^^^^^^^^

numpy.sometrue has also been removed.

Changing these sections to N.float64 and N.any respectively fixed these issues.

@reticulatus
Copy link
Contributor

Yes, numpy.sometrue() has been raising DeprecationWarnings for a while now, see #2498

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

Successfully merging a pull request may close this issue.

2 participants