mirror of
https://github.com/romanz/amodem.git
synced 2026-03-23 02:39:26 +08:00
PEP8 fixes
lambdas and coverage
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from amodem import common
|
||||
from amodem import config
|
||||
import numpy as np
|
||||
|
||||
|
||||
@@ -59,3 +60,11 @@ def test_holder():
|
||||
assert a.x == d['x']
|
||||
assert a.y == d['y']
|
||||
assert repr(a) == 'AttributeHolder(x=1, y=2.3)'
|
||||
|
||||
|
||||
def test_configs():
|
||||
default = config.Configuration()
|
||||
fastest = config.fastest()
|
||||
slowest = config.slowest()
|
||||
assert slowest.modem_bps <= default.modem_bps
|
||||
assert fastest.modem_bps >= default.modem_bps
|
||||
|
||||
@@ -48,7 +48,9 @@ def test_qam():
|
||||
decoded = list(q.decode(S))
|
||||
assert decoded == bits
|
||||
|
||||
noise = lambda A: A*(r.uniform(-1, 1) + 1j*r.uniform(-1, 1))
|
||||
def noise(A):
|
||||
return A*(r.uniform(-1, 1) + 1j*r.uniform(-1, 1))
|
||||
|
||||
noised_symbols = [(s + noise(1e-3)) for s in S]
|
||||
decoded = list(q.decode(noised_symbols))
|
||||
assert decoded == bits
|
||||
|
||||
Reference in New Issue
Block a user