Skip to content

Commit

Permalink
third round of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunyez committed Sep 29, 2023
1 parent ded57ec commit 01ec056
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/vse_sync_pp/analyzers/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions tests/vse_sync_pp/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit 01ec056

Please sign in to comment.