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

May 29, 2022 commit results python error. #511

Closed
w5pny opened this issue May 30, 2022 · 2 comments
Closed

May 29, 2022 commit results python error. #511

w5pny opened this issue May 30, 2022 · 2 comments
Labels
bug Something isn't working stale Long time no reaction, will be closed soon

Comments

@w5pny
Copy link

w5pny commented May 30, 2022

Ubvuntu 20.04 python 3.8

With the May 29 2022 commit, I always get:

Traceback (most recent call last):
File "/usr/local/lib/nanovnasaver/nanovna-saver.py", line 26, in
from NanoVNASaver.main import main
File "/usr/local/lib/nanovnasaver/NanoVNASaver/main.py", line 36, in
from NanoVNASaver.NanoVNASaver import NanoVNASaver
File "/usr/local/lib/nanovnasaver/NanoVNASaver/NanoVNASaver.py", line 28, in
from .Windows import (
File "/usr/local/lib/nanovnasaver/NanoVNASaver/Windows/init.py", line 6, in
from .DisplaySettings import DisplaySettingsWindow
File "/usr/local/lib/nanovnasaver/NanoVNASaver/Windows/DisplaySettings.py", line 25, in
from NanoVNASaver.Charts.Chart import (
File "/usr/local/lib/nanovnasaver/NanoVNASaver/Charts/init.py", line 2, in
from .Frequency import FrequencyChart
File "/usr/local/lib/nanovnasaver/NanoVNASaver/Charts/Frequency.py", line 37, in
class FrequencyChart(Chart):
File "/usr/local/lib/nanovnasaver/NanoVNASaver/Charts/Frequency.py", line 453, in FrequencyChart
def _data_oob(self, data: list[Datapoint]) -> bool:
TypeError: 'type' object is not subscriptable

I don't know if this is sufficient, but it seems to clear the error so far:

--- ./NanoVNASaver/Charts/Frequency.py.orig 2022-05-29 10:40:50.000000000 -0600
+++ ./NanoVNASaver/Charts/Frequency.py 2022-05-30 10:39:48.863412359 -0600
@@ -450,7 +450,7 @@
self.drawDragbog(qp)
qp.end()

  • def _data_oob(self, data: list[Datapoint]) -> bool:
  • def _data_oob(self, data: list) -> bool:
    return (data[0].freq > self.fstop or self.data[-1].freq < self.fstart)

    def _check_frequency_boundaries(self, qp: QtGui.QPainter):

@zarath zarath added bug Something isn't working stale Long time no reaction, will be closed soon labels Sep 18, 2022
@zarath
Copy link
Collaborator

zarath commented Sep 20, 2022

Could be related by leaked numpy arrays to locations where python array is expected.
Stil valid with v0.5.3?

@mercy2ro
Copy link

I think this is because the difference between python3.8 and python3.9.

https://peps.python.org/pep-0585/
#522

So this issue will be solved by the following change.

def _data_oob(self, data: list[Datapoint]) -> bool:

def _data_oob(self, data: List[Datapoint]) -> bool:

After this change, the error went away. (In my python3.8 environment)

zarath added a commit to zarath/nanovna-saver that referenced this issue Sep 29, 2022
@zarath zarath closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Long time no reaction, will be closed soon
Projects
None yet
Development

No branches or pull requests

3 participants