diff options
author | mormj <mormjb@gmail.com> | 2020-10-30 10:59:50 -0400 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-10-30 17:52:53 +0100 |
commit | 7a0948ba85758fba1cc3858ef99bfa600dcc7416 (patch) | |
tree | 610d7f9d773a193562def6df2d4b50f1bb3b3f86 /gr-blocks/python/blocks/qa_vector_map.py | |
parent | 12192ee7d58de95ddca35a3e93bfc172bdb5c820 (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_vector_map.py')
-rw-r--r-- | gr-blocks/python/blocks/qa_vector_map.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gr-blocks/python/blocks/qa_vector_map.py b/gr-blocks/python/blocks/qa_vector_map.py index e2001537eb..a0c9b6dc3e 100644 --- a/gr-blocks/python/blocks/qa_vector_map.py +++ b/gr-blocks/python/blocks/qa_vector_map.py @@ -12,6 +12,7 @@ from gnuradio import gr, gr_unittest, blocks import math + class test_vector_map(gr_unittest.TestCase): def setUp(self): @@ -25,9 +26,9 @@ class test_vector_map(gr_unittest.TestCase): N = 5 src_data = list(range(0, 20)) expected_result = [] - for i in range(N-1, len(src_data), N): + for i in range(N - 1, len(src_data), N): for j in range(0, N): - expected_result.append(1.0*(i-j)) + expected_result.append(1.0 * (i - j)) mapping = [list(reversed([(0, i) for i in range(0, N)]))] src = blocks.vector_source_f(src_data, False, N) vmap = blocks.vector_map(gr.sizeof_float, (N, ), mapping) @@ -69,13 +70,13 @@ class test_vector_map(gr_unittest.TestCase): expected_D = [1, 11, 2, 12, 3, 13, 4, 14, 5, 15] expected_E = [1, 11, 98, 99, 2, 12, 96, 97, 3, 13, 94, 95, 4, 14, 92, 93, 5, 15, 90, 91] - mapping = [[(0, 0), (1, 0)], # mapping to produce D - [(0, 0), (1, 0), (2, 1), (2, 0)], # mapping to produce E + mapping = [[(0, 0), (1, 0)], # mapping to produce D + [(0, 0), (1, 0), (2, 1), (2, 0)], # mapping to produce E ] srcA = blocks.vector_source_f(A, False, 1) srcB = blocks.vector_source_f(B, False, 1) srcC = blocks.vector_source_f(C, False, 2) - vmap = blocks.vector_map(gr.sizeof_int, (1, 1, 2), mapping) + vmap = blocks.vector_map(gr.sizeof_int, (1, 1, 2), mapping) dstD = blocks.vector_sink_f(2) dstE = blocks.vector_sink_f(4) self.tb.connect(srcA, (vmap, 0)) @@ -87,6 +88,6 @@ class test_vector_map(gr_unittest.TestCase): self.assertEqual(expected_D, dstD.data()) self.assertEqual(expected_E, dstE.data()) + if __name__ == '__main__': gr_unittest.run(test_vector_map) - |