diff --git a/.gitignore b/.gitignore index de60a422..0397fbf6 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,6 @@ friture.egg-info Notepad++ .idea .vscode +.qt_for_python .mypy_cache \ No newline at end of file diff --git a/friture/histplot.py b/friture/histplot.py index 7a934cc2..c903c90e 100644 --- a/friture/histplot.py +++ b/friture/histplot.py @@ -412,11 +412,11 @@ def setspecrange(self, spec_min, spec_max): self.update() def setweighting(self, weighting): - if weighting is 0: + if weighting == 0: title = "PSD (dB)" - elif weighting is 1: + elif weighting == 1: title = "PSD (dB A)" - elif weighting is 2: + elif weighting == 2: title = "PSD (dB B)" else: title = "PSD (dB C)" diff --git a/friture/imageplot.py b/friture/imageplot.py index 06b1b75f..fa7ddda5 100644 --- a/friture/imageplot.py +++ b/friture/imageplot.py @@ -310,11 +310,11 @@ def setspecrange(self, spec_min, spec_max): self.update() def setweighting(self, weighting): - if weighting is 0: + if weighting == 0: title = "PSD (dB)" - elif weighting is 1: + elif weighting == 1: title = "PSD (dB A)" - elif weighting is 2: + elif weighting == 2: title = "PSD (dB B)" else: title = "PSD (dB C)" diff --git a/friture/octavespectrum.py b/friture/octavespectrum.py index 8f65e86a..4c49f700 100644 --- a/friture/octavespectrum.py +++ b/friture/octavespectrum.py @@ -116,11 +116,11 @@ def handle_new_data(self, floatdata): sp = array(sp) - if self.weighting is 0: + if self.weighting == 0: w = 0. - elif self.weighting is 1: + elif self.weighting == 1: w = self.filters.A - elif self.weighting is 2: + elif self.weighting == 2: w = self.filters.B else: w = self.filters.C diff --git a/friture/spectrogram.py b/friture/spectrogram.py index 19197632..b040520f 100644 --- a/friture/spectrogram.py +++ b/friture/spectrogram.py @@ -218,11 +218,11 @@ def setweighting(self, weighting): def update_weighting(self): A, B, C = self.proc.get_freq_weighting() - if self.weighting is 0: + if self.weighting == 0: self.w = array([0.]) - elif self.weighting is 1: + elif self.weighting == 1: self.w = A - elif self.weighting is 2: + elif self.weighting == 2: self.w = B else: self.w = C diff --git a/friture/spectrum.py b/friture/spectrum.py index 9cfc1af5..e170bb2a 100644 --- a/friture/spectrum.py +++ b/friture/spectrum.py @@ -239,11 +239,11 @@ def setweighting(self, weighting): def update_weighting(self): A, B, C = self.proc.get_freq_weighting() - if self.weighting is 0: + if self.weighting == 0: self.w = zeros(A.shape) - elif self.weighting is 1: + elif self.weighting == 1: self.w = A - elif self.weighting is 2: + elif self.weighting == 2: self.w = B else: self.w = C diff --git a/friture/spectrumPlotWidget.py b/friture/spectrumPlotWidget.py index d4d7065b..d563ee7a 100644 --- a/friture/spectrumPlotWidget.py +++ b/friture/spectrumPlotWidget.py @@ -107,11 +107,11 @@ def setspecrange(self, spec_min, spec_max): self.normVerticalScaleTransform.setRange(spec_min, spec_max) def setweighting(self, weighting): - if weighting is 0: + if weighting == 0: title = "PSD (dB)" - elif weighting is 1: + elif weighting == 1: title = "PSD (dB A)" - elif weighting is 2: + elif weighting == 2: title = "PSD (dB B)" else: title = "PSD (dB C)"