summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/qa_vco.py
diff options
context:
space:
mode:
authormormj <mormjb@gmail.com>2020-10-30 10:59:50 -0400
committerMarcus Müller <marcus@hostalia.de>2020-10-30 17:52:53 +0100
commit7a0948ba85758fba1cc3858ef99bfa600dcc7416 (patch)
tree610d7f9d773a193562def6df2d4b50f1bb3b3f86 /gr-blocks/python/blocks/qa_vco.py
parent12192ee7d58de95ddca35a3e93bfc172bdb5c820 (diff)
qa: run autopep8 formatting on qa python files
find ./ -iname qa*.py | xargs autopep8 --in-place -a -a mostly formats whitespace and gets rid of trailing semicolons
Diffstat (limited to 'gr-blocks/python/blocks/qa_vco.py')
-rw-r--r--gr-blocks/python/blocks/qa_vco.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/gr-blocks/python/blocks/qa_vco.py b/gr-blocks/python/blocks/qa_vco.py
index 354eb7b42c..7ebdedc8e2 100644
--- a/gr-blocks/python/blocks/qa_vco.py
+++ b/gr-blocks/python/blocks/qa_vco.py
@@ -12,28 +12,31 @@
from gnuradio import gr, gr_unittest, blocks
import math
+
def sig_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_rate for x in range(N)]
- y = [amp*math.cos(2.*math.pi*freq*x) for x in t]
+ y = [amp * math.cos(2. * math.pi * freq * x) for x in t]
return y
+
def sig_source_c(samp_rate, freq, amp, N):
t = [float(x) / samp_rate for x in range(N)]
- y = [math.cos(2.*math.pi*freq*x) + \
- 1j*math.sin(2.*math.pi*freq*x) for x in t]
+ y = [math.cos(2. * math.pi * freq * x) +
+ 1j * math.sin(2. * math.pi * freq * x) for x in t]
return y
+
class test_vco(gr_unittest.TestCase):
- def setUp (self):
- self.tb = gr.top_block ()
+ def setUp(self):
+ self.tb = gr.top_block()
- def tearDown (self):
+ def tearDown(self):
self.tb = None
def test_001(self):
- src_data = 200*[0,] + 200*[0.5,] + 200*[1,]
- expected_result = 200*[1,] + \
+ src_data = 200 * [0, ] + 200 * [0.5, ] + 200 * [1, ]
+ expected_result = 200 * [1, ] + \
sig_source_f(1, 0.125, 1, 200) + \
sig_source_f(1, 0.25, 1, 200)
@@ -47,10 +50,9 @@ class test_vco(gr_unittest.TestCase):
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result, result_data, 5)
-
def test_002(self):
- src_data = 200*[0,] + 200*[0.5,] + 200*[1,]
- expected_result = 200*[1,] + \
+ src_data = 200 * [0, ] + 200 * [0.5, ] + 200 * [1, ]
+ expected_result = 200 * [1, ] + \
sig_source_c(1, 0.125, 1, 200) + \
sig_source_c(1, 0.25, 1, 200)
@@ -67,4 +69,3 @@ class test_vco(gr_unittest.TestCase):
if __name__ == '__main__':
gr_unittest.run(test_vco)
-