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/pmt | |
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/pmt')
-rw-r--r-- | gnuradio-runtime/python/pmt/qa_pmt.py | 14 | ||||
-rw-r--r-- | gnuradio-runtime/python/pmt/qa_pmt_to_python.py | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/gnuradio-runtime/python/pmt/qa_pmt.py b/gnuradio-runtime/python/pmt/qa_pmt.py index 9a08ed39b4..1e879aae29 100644 --- a/gnuradio-runtime/python/pmt/qa_pmt.py +++ b/gnuradio-runtime/python/pmt/qa_pmt.py @@ -12,10 +12,11 @@ import unittest import pmt + class test_pmt(unittest.TestCase): - MAXINT32 = (2**31)-1 - MININT32 = (-MAXINT32)-1 + MAXINT32 = (2**31) - 1 + MININT32 = (-MAXINT32) - 1 def setUp(self): from ctypes import sizeof, c_long @@ -204,7 +205,8 @@ class test_pmt(unittest.TestCase): out_str = pmt.serialize_str(d) self.assertEqual(out_str, in_str) in_str = b'\t\x07\x02\x00\x03vec\n\x00\x00\x00\x00\x04\x01\x00\x01\x02\x03\x04\x06' - d = pmt.dict_add(pmt.make_dict(), pmt.intern('vec'), pmt.init_u8vector(4, [1, 2, 3, 4])) + d = pmt.dict_add(pmt.make_dict(), pmt.intern('vec'), + pmt.init_u8vector(4, [1, 2, 3, 4])) out_pmt = pmt.deserialize_str(in_str) self.assertTrue(pmt.equal(out_pmt, d)) @@ -340,7 +342,7 @@ class test_pmt(unittest.TestCase): self.assertEqual(out_vec, in_vec) # c32_vector SERDES - in_vec = [0x01020304-1j, 3.1415+99.99j] + in_vec = [0x01020304 - 1j, 3.1415 + 99.99j] # old serialization (c32 serialized as c64): # in_str = b'\n\n\x00\x00\x00\x02\x01\x00Ap 0@\x00\x00\x00\xbf\xf0\x00\x00\x00\x00\x00\x00@\t!\xca\xc0\x00\x00\x00@X\xff\\ \x00\x00\x00' in_str = b'\n\n\x00\x00\x00\x02\x01\x00\xbf\x80\x00\x00K\x81\x01\x82B\xc7\xfa\xe1@I\x0eV' @@ -349,7 +351,7 @@ class test_pmt(unittest.TestCase): # old serialization (c32 serialized as c64): # in_str = b'\n\n\x00\x00\x00\x02\x01\x00?\xf0\x00\x00\x00\x00\x00\x00?\xf0\x00\x00\x00\x00\x00\x00?\xc0\x00\x00\x00\x00\x00\x00\xc1c\x12\xcf\xe0\x00\x00\x00' in_str = b'\n\n\x00\x00\x00\x02\x01\x00?\x80\x00\x00?\x80\x00\x00\xcb\x18\x96\x7f>\x00\x00\x00' - in_vec = [1+1j, .125-9999999j] + in_vec = [1 + 1j, .125 - 9999999j] out_vec = pmt.c32vector_elements(pmt.deserialize_str(in_str)) self.assertEqual(out_vec, in_vec) @@ -359,7 +361,7 @@ class test_pmt(unittest.TestCase): out_str = pmt.serialize_str(pmt.init_c64vector(len(in_vec), in_vec)) self.assertEqual(out_str, in_str) in_str = b'\n\x0b\x00\x00\x00\x02\x01\x00?\xf0\x00\x00\x00\x00\x00\x00?\xf0\x00\x00\x00\x00\x00\x00?\xc0\x00\x00\x00\x00\x00\x00\xc1c\x12\xcf\xe0\x00\x00\x00' - in_vec = [1+1j, .125-9999999j] + in_vec = [1 + 1j, .125 - 9999999j] out_vec = pmt.c64vector_elements(pmt.deserialize_str(in_str)) self.assertEqual(out_vec, in_vec) diff --git a/gnuradio-runtime/python/pmt/qa_pmt_to_python.py b/gnuradio-runtime/python/pmt/qa_pmt_to_python.py index 3fed489d8c..0d96cb800d 100644 --- a/gnuradio-runtime/python/pmt/qa_pmt_to_python.py +++ b/gnuradio-runtime/python/pmt/qa_pmt_to_python.py @@ -9,11 +9,11 @@ # - import unittest import pmt from pmt import pmt_to_python as pmt2py + class test_pmt_to_python(unittest.TestCase): def test_pmt_from_double(self): @@ -29,10 +29,9 @@ class test_pmt_to_python(unittest.TestCase): narr.imag[:] = np.random.uniform(size=N) uvector = pmt2py.numpy_to_uvector(narr) nparr = pmt2py.uvector_to_numpy(uvector) - self.assertTrue(nparr.dtype==narr.dtype) + self.assertTrue(nparr.dtype == narr.dtype) self.assertTrue(np.alltrue(nparr == narr)) - if __name__ == '__main__': unittest.main() |