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

Errors running SignalIntegrity GUI Python 3.12, numpy==2.0.0 #81

Open
dracid opened this issue Oct 28, 2024 · 5 comments
Open

Errors running SignalIntegrity GUI Python 3.12, numpy==2.0.0 #81

dracid opened this issue Oct 28, 2024 · 5 comments

Comments

@dracid
Copy link

dracid commented Oct 28, 2024

After installing Signal Integrity App and trying to run, getting the following error message:

Traceback (most recent call last):
  File "/home/dracid/spyder-env/bin/SignalIntegrity", line 5, in <module>
    from SignalIntegrity.App.SignalIntegrityApp import main
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/App/__init__.py", line 21, in <module>
    from .SignalIntegrityApp import SignalIntegrityApp
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/App/SignalIntegrityApp.py", line 38, in <module>
    from SignalIntegrity.Lib.ToSI import ToSI
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/Lib/__init__.py", line 22, in <module>
    from . import SystemDescriptions as sd
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/Lib/SystemDescriptions/__init__.py", line 21, in <module>
    from .SystemDescription import *
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/Lib/SystemDescriptions/SystemDescription.py", line 23, in <module>
    from SignalIntegrity.Lib.Devices import Tee
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/Lib/Devices/__init__.py", line 28, in <module>
    from .SeriesC import SeriesC
  File "/home/dracid/Documents/openSI/SignalIntegrity-1.4.1/SignalIntegrity/Lib/Devices/SeriesC.py", line 21, in <module>
    from numpy import math
ImportError: cannot import name 'math' from 'numpy' (/home/dracid/spyder-env/lib/python3.12/site-packages/numpy/__init__.py). Did you mean: 'emath'?

Running Ubuntu Linux 24.04, Python 3.12, Numpy numpy==2.0.0, SignalIntegrityApp 1.4.1

Searching online, seems Numpy 2.0 has deprecated .math part of the library. Perhaps that can be the reason?

@dracid dracid changed the title Errors running Errors running SignalIntegrity GUI Python 3.12, Numpy numpy==2.0.0 Oct 28, 2024
@dracid dracid changed the title Errors running SignalIntegrity GUI Python 3.12, Numpy numpy==2.0.0 Errors running SignalIntegrity GUI Python 3.12, numpy==2.0.0 Oct 28, 2024
@dracid
Copy link
Author

dracid commented Oct 28, 2024

Seems like the following several files need to be edited to import "pi" instead of "math" and it works great after:
image

@Phi-sqrd
Copy link

@dracid , your initial post suggested modifying only the use of pi, but on my system (macOS Monterey 12.3.1), I found it necessary to update both pi and sqrt to maintain functionality.

Changes Made

I modified the following five files, which are named after the functions defined within them:

SeriesRse.py
SeriesL.py
SeriesC.py
TerminationC.py
TerminationL.py

In each file:

  • Removed the import statement for math.
  • Imported pi and sqrt directly from numpy.
from numpy import pi
from numpy import sqrt
  • Replaced instances of math.pi and math.sqrt with the newly imported pi and sqrt.

Thanks to @dracid for the fix! the App works!

@dracid
Copy link
Author

dracid commented Oct 30, 2024

Thanks, glad this helped!! I hope I can create a pull request :)) Need to learn how to do this.

My bad, you are totally right --> math.sqrt also had to be replaced.

@Phi-sqrd
Copy link

That was incredibly helpful @dracid ! Thank you so much. I'm really looking forward to trying out the code with your PR.

dracid added a commit to dracid/SignalIntegrity that referenced this issue Nov 3, 2024
Because numpy.math was deprecated in numpy=2.0.0
Resolved issue Nubis-Communications#81:
Nubis-Communications#81
PetePupalaikis pushed a commit that referenced this issue Nov 13, 2024
Because numpy.math was deprecated in numpy=2.0.0
Resolved issue #81:
#81
@PetePupalaikis
Copy link
Contributor

I merged this into InNextRelease after making some small changes. Please mark this as closed if you agree.

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

3 participants