From 01ec05617094e6c694ef543d9fdbe799a0131c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Nu=C3=B1ez?= Date: Fri, 29 Sep 2023 11:06:56 +0200 Subject: [PATCH] third round of comments --- src/vse_sync_pp/analyzers/analyzer.py | 8 ++++---- tests/vse_sync_pp/test_requirements.py | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/vse_sync_pp/analyzers/analyzer.py b/src/vse_sync_pp/analyzers/analyzer.py index b1caa83..3758dd9 100644 --- a/src/vse_sync_pp/analyzers/analyzer.py +++ b/src/vse_sync_pp/analyzers/analyzer.py @@ -414,7 +414,7 @@ def __init__(self, config): self._samples = None def test(self, data): - result = super()._test_common(data) + result = self._test_common(data) if result is None: if self._samples is None: self._taus, self._samples, errors, ns = allantools.tdev(self._lpf_signal, rate=self._rate, data_type="phase", taus=self._taus_list) # noqa @@ -424,7 +424,7 @@ def test(self, data): return result def explain(self, data): - analysis = super()._explain_common(data) + analysis = self._explain_common(data) if analysis is None: if self._samples is None: self._taus, self._samples, errors, ns = allantools.tdev(self._lpf_signal, rate=self._rate, data_type="phase", taus=self._taus_list) # noqa @@ -455,7 +455,7 @@ def __init__(self, config): self._samples = None def test(self, data): - result = super()._test_common(data) + result = self._test_common(data) if result is None: if self._samples is None: self._taus, self._samples, errors, ns = allantools.mtie(self._lpf_signal, rate=self._rate, data_type="phase", taus=self._taus_list) # noqa @@ -465,7 +465,7 @@ def test(self, data): return result def explain(self, data): - analysis = super()._explain_common(data) + analysis = self._explain_common(data) if analysis is None: if self._samples is None: self._taus, self._samples, errors, ns = allantools.mtie(self._lpf_signal, rate=self._rate, data_type="phase", taus=self._taus_list) # noqa diff --git a/tests/vse_sync_pp/test_requirements.py b/tests/vse_sync_pp/test_requirements.py index 26b649a..83bb786 100644 --- a/tests/vse_sync_pp/test_requirements.py +++ b/tests/vse_sync_pp/test_requirements.py @@ -16,15 +16,16 @@ def test_g8272_prtc_a(self): self.assertEqual(REQUIREMENTS['G.8272/PRTC-A']['time-error-in-locked-mode/ns'], 100) - (a, f1), (c, f2) = REQUIREMENTS['G.8272/PRTC-A']['maximum-time-interval-error-in-locked-mode/us'].items() + (interval1, func1), (interval2, func2) = REQUIREMENTS['G.8272/PRTC-A']['maximum-time-interval-error-in-locked-mode/us'].items() # noqa - self.assertEqual(f1(100), 0.052500000000000005) - self.assertEqual(f2(300), 0.10) + # floating point math representation + self.assertEqual(func1(100), 0.052500000000000005) + self.assertEqual(func2(300), 0.10) - (a, f1), (c, f2), (e, f3) = REQUIREMENTS['G.8272/PRTC-A']['time-deviation-in-locked-mode/ns'].items() - self.assertEqual(f1(100), 3) - self.assertEqual(f2(150), 4.5) - self.assertEqual(f3(550), 30) + (interval1, func1), (interval2, func2), (interval3, func3) = REQUIREMENTS['G.8272/PRTC-A']['time-deviation-in-locked-mode/ns'].items() # noqa + self.assertEqual(func1(100), 3) + self.assertEqual(func2(150), 4.5) + self.assertEqual(func3(550), 30) def test_g8272_prtc_b(self): """Test G.8272/PRTC-B requirement values"""