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 /gnuradio-runtime/python/gnuradio | |
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 'gnuradio-runtime/python/gnuradio')
6 files changed, 45 insertions, 31 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py index 1907656592..893b02cb07 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py @@ -13,12 +13,13 @@ import time import pmt from gnuradio import gr, gr_unittest, blocks + class test_flowgraph (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_000(self): @@ -42,6 +43,6 @@ class test_flowgraph (gr_unittest.TestCase): data = pmt.u8vector_elements(pmt.cdr(dbg.get_message(0))) self.assertEqual([1, 2, 3], data) + if __name__ == '__main__': gr_unittest.run(test_flowgraph) - diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py b/gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py index a5895e8db0..3e42c79b7d 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py @@ -15,27 +15,27 @@ import pmt class test_hblk(gr.hier_block2): - def __init__(self, io_sig=1*[gr.sizeof_gr_complex], ndebug=2): + def __init__(self, io_sig=1 * [gr.sizeof_gr_complex], ndebug=2): # parent constructor - gr.hier_block2.__init__(self, - "test_hblk", - gr.io_signature(len(io_sig), len(io_sig), io_sig[0]), - gr.io_signature(0,0,0)) + gr.hier_block2.__init__( + self, "test_hblk", gr.io_signature( + len(io_sig), len(io_sig), io_sig[0]), gr.io_signature( + 0, 0, 0)) - self.message_port_register_hier_in("msg_in"); + self.message_port_register_hier_in("msg_in") # Internal Stream Blocks self.vsnk = blocks.vector_sink_c() # Internal Msg Blocks - self.blks = []; + self.blks = [] for i in range(0, ndebug): - self.blks.append( blocks.message_debug() ) + self.blks.append(blocks.message_debug()) # Set up internal connections - self.connect( self, self.vsnk ) + self.connect(self, self.vsnk) for blk in self.blks: - self.msg_connect( self, "msg_in", blk, "print" ) + self.msg_connect(self, "msg_in", blk, "print") class test_hier_block2(gr_unittest.TestCase): @@ -103,30 +103,42 @@ class test_hier_block2(gr_unittest.TestCase): self.multi(self.Block(), 5) def test_010(self): - s, h, k = analog.sig_source_c(44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.head(gr.sizeof_gr_complex, 1000), test_hblk([gr.sizeof_gr_complex], 0) + s, h, k = analog.sig_source_c(44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.head( + gr.sizeof_gr_complex, 1000), test_hblk([gr.sizeof_gr_complex], 0) tb = gr.top_block() - tb.connect(s,h,k) + tb.connect(s, h, k) tb.run() def test_011(self): - s, st, h, k = analog.sig_source_c(44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.message_strobe(pmt.PMT_NIL, 100), blocks.head(gr.sizeof_gr_complex, 1000), test_hblk([gr.sizeof_gr_complex], 1) + s, st, h, k = analog.sig_source_c( + 44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.message_strobe( + pmt.PMT_NIL, 100), blocks.head( + gr.sizeof_gr_complex, 1000), test_hblk( + [ + gr.sizeof_gr_complex], 1) tb = gr.top_block() - tb.connect(s,h,k) - tb.msg_connect(st,"strobe",k,"msg_in") + tb.connect(s, h, k) + tb.msg_connect(st, "strobe", k, "msg_in") tb.start() time.sleep(1) tb.stop() tb.wait() def test_012(self): - s, st, h, k = analog.sig_source_c(44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.message_strobe(pmt.PMT_NIL, 100), blocks.head(gr.sizeof_gr_complex, 1000), test_hblk([gr.sizeof_gr_complex], 16) + s, st, h, k = analog.sig_source_c( + 44100, analog.GR_COS_WAVE, 440, 1.0, 0.0), blocks.message_strobe( + pmt.PMT_NIL, 100), blocks.head( + gr.sizeof_gr_complex, 1000), test_hblk( + [ + gr.sizeof_gr_complex], 16) tb = gr.top_block() - tb.connect(s,h,k) - tb.msg_connect(st,"strobe",k,"msg_in") + tb.connect(s, h, k) + tb.msg_connect(st, "strobe", k, "msg_in") tb.start() time.sleep(1) tb.stop() tb.wait() + if __name__ == '__main__': gr_unittest.run(test_hier_block2) diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_kludged_imports.py b/gnuradio-runtime/python/gnuradio/gr/qa_kludged_imports.py index 401fa7ddae..257aa3a761 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_kludged_imports.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_kludged_imports.py @@ -11,6 +11,7 @@ from gnuradio import gr, gr_unittest + class test_kludged_imports (gr_unittest.TestCase): def setUp(self): diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_prefs.py b/gnuradio-runtime/python/gnuradio/gr/qa_prefs.py index fcda8f7b53..f5a8c93baf 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_prefs.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_prefs.py @@ -9,9 +9,9 @@ # - from gnuradio import gr, gr_unittest + class test_prefs (gr_unittest.TestCase): def test_001(self): @@ -21,7 +21,9 @@ class test_prefs (gr_unittest.TestCase): self.assertFalse(p.has_option('doesnt', 'exist')) # At the time these tests are run, there is not necessarily a default - # configuration on the build system, so not much to do with testing here + # configuration on the build system, so not much to do with testing + # here + if __name__ == '__main__': gr_unittest.run(test_prefs) diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_random.py b/gnuradio-runtime/python/gnuradio/gr/qa_random.py index 24823487e2..fa8c44917b 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_random.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_random.py @@ -14,7 +14,8 @@ import numpy as np class test_random(gr_unittest.TestCase): - # NOTE: For tests on the output distribution of the random numbers, see gnuradio-runtime/apps/evaluation_random_numbers.py. + # NOTE: For tests on the output distribution of the random numbers, see + # gnuradio-runtime/apps/evaluation_random_numbers.py. # Check for range [0,1) of uniform distributed random numbers def test_1(self): diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py b/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py index b3a510f98a..96706377a3 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_tag_utils.py @@ -9,18 +9,16 @@ # - from gnuradio import gr, gr_unittest import pmt class test_tag_utils (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): @@ -100,4 +98,3 @@ class test_tag_utils (gr_unittest.TestCase): if __name__ == '__main__': print('hi') gr_unittest.run(test_tag_utils) - |