From fec88a5314e1478a870530dc704de7b734b31cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Nu=C3=B1ez?= Date: Fri, 6 Oct 2023 11:11:43 +0200 Subject: [PATCH] fix lint --- src/vse_sync_pp/analyzers/analyzer.py | 2 ++ src/vse_sync_pp/plot.py | 6 +++--- tests/vse_sync_pp/test_requirements.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vse_sync_pp/analyzers/analyzer.py b/src/vse_sync_pp/analyzers/analyzer.py index 78f12cc..32886e5 100644 --- a/src/vse_sync_pp/analyzers/analyzer.py +++ b/src/vse_sync_pp/analyzers/analyzer.py @@ -402,6 +402,7 @@ def _generate_taus(self): self._lpf_signal = calculate_filter(self._data, self._transient, self._rate) return None + class TimeDeviationAnalyzerBase(TimeIntervalErrorAnalyzerBase): """Analyze Time Deviation (TDEV). @@ -477,6 +478,7 @@ def test(self, data): return (False, "unacceptable mtie") return (True, None) return result + def explain(self, data): analysis = self._explain_common(data) if analysis is None: diff --git a/src/vse_sync_pp/plot.py b/src/vse_sync_pp/plot.py index 7cf634a..c236958 100644 --- a/src/vse_sync_pp/plot.py +++ b/src/vse_sync_pp/plot.py @@ -39,7 +39,7 @@ def append(self, data): """Append x and y data points extracted from `data`""" self._x_data.append(self._extract_attr(self._x, data)) self._y_data.append(self._extract_attr(self._y, data)) - + def _plot_scatter(self, ax): ax.axhline(0, color='black') self._set_yscale(ax) @@ -48,7 +48,7 @@ def _plot_scatter(self, ax): ax.plot(self._x_data, self._y_data, '.') ax.grid() ax.set_title(f'{self._x.desc} vs {self._y.desc}') - + def _plot_hist(self, ax): counts, bins = np.histogram( np.array(self._y_data, dtype=float), @@ -75,7 +75,7 @@ def plot_scatter(self, filename): self._plot_scatter(ax) plt.savefig(filename) return fig, ax - + def plot_histogram(self, filename): fig, ax = plt.subplots(1, constrained_layout=True) fig.set_size_inches(10, 4) diff --git a/tests/vse_sync_pp/test_requirements.py b/tests/vse_sync_pp/test_requirements.py index 9f77c77..4071c54 100644 --- a/tests/vse_sync_pp/test_requirements.py +++ b/tests/vse_sync_pp/test_requirements.py @@ -31,7 +31,7 @@ def test_g8272_prtc_b(self): self.assertEqual(REQUIREMENTS['G.8272/PRTC-B']['time-error-in-locked-mode/ns'], 40) - (interval1, func1), (interval2, func2) = REQUIREMENTS['G.8272/PRTC-B']['maximum-time-interval-error-in-locked-mode/ns'].items() + (interval1, func1), (interval2, func2) = REQUIREMENTS['G.8272/PRTC-B']['maximum-time-interval-error-in-locked-mode/ns'].items() # noqa self.assertEqual(func1(100), 52.5) self.assertEqual(func2(300), 40)