diff options
author | Josh Morman <jmorman@gnuradio.org> | 2021-11-24 12:25:09 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-11-24 14:41:53 -0500 |
commit | 3cecf9268b15bb0e9e2fedaeb2528bd3038beee6 (patch) | |
tree | ba0bb14fa03664b4e69e0dcb944b96ae298264d8 /gr-digital/python/digital/qa_constellation_encoder_bc.py | |
parent | 310b7f0cc25edf90c0bc6754031d763119b0ae97 (diff) |
digital: pep8 formatting
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
Diffstat (limited to 'gr-digital/python/digital/qa_constellation_encoder_bc.py')
-rw-r--r-- | gr-digital/python/digital/qa_constellation_encoder_bc.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gr-digital/python/digital/qa_constellation_encoder_bc.py b/gr-digital/python/digital/qa_constellation_encoder_bc.py index 2c6d587dac..ef1991bf80 100644 --- a/gr-digital/python/digital/qa_constellation_encoder_bc.py +++ b/gr-digital/python/digital/qa_constellation_encoder_bc.py @@ -12,6 +12,7 @@ from gnuradio import gr, gr_unittest, digital, blocks import numpy as np + class test_constellation_encoder(gr_unittest.TestCase): def setUp(self): @@ -23,8 +24,8 @@ class test_constellation_encoder(gr_unittest.TestCase): def test_constellation_encoder_bc_bpsk(self): cnst = digital.constellation_bpsk() - src_data = (1, 1, 0, 0, - 1, 0, 1) + src_data = (1, 1, 0, 0, + 1, 0, 1) const_map = [-1.0, 1.0] expected_result = [const_map[x] for x in src_data] @@ -43,8 +44,8 @@ class test_constellation_encoder(gr_unittest.TestCase): def test_constellation_encoder_bc_qpsk(self): cnst = digital.constellation_qpsk() - src_data = (3, 1, 0, 2, - 3, 2, 1) + src_data = (3, 1, 0, 2, + 3, 2, 1) expected_result = [cnst.points()[x] for x in src_data] src = blocks.vector_source_b(src_data) op = digital.constellation_encoder_bc(cnst.base()) @@ -59,7 +60,6 @@ class test_constellation_encoder(gr_unittest.TestCase): # print "expected result", expected_result self.assertFloatTuplesAlmostEqual(expected_result, actual_result) - def test_constellation_encoder_bc_qpsk_random(self): cnst = digital.constellation_qpsk() src_data = np.random.randint(0, 4, size=20000) @@ -77,5 +77,6 @@ class test_constellation_encoder(gr_unittest.TestCase): # print "expected result", expected_result self.assertFloatTuplesAlmostEqual(expected_result, actual_result) + if __name__ == '__main__': gr_unittest.run(test_constellation_encoder) |