From ceaf893675283a10fc42a93697c697c27961aed0 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Wed, 1 Nov 2017 13:09:32 +0200 Subject: [PATCH] config: use '//' for Python 3 (instead of '/') --- amodem/config.py | 2 +- amodem/tests/test_configs.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/amodem/config.py b/amodem/config.py index a6881f2..90c99de 100644 --- a/amodem/config.py +++ b/amodem/config.py @@ -51,7 +51,7 @@ class Configuration(object): ]) # QAM constellation - Nx = 2 ** int(np.ceil(bits_per_symbol / 2)) + Nx = 2 ** int(np.ceil(bits_per_symbol // 2)) Ny = self.Npoints // Nx symbols = [complex(x, y) for x in range(Nx) for y in range(Ny)] symbols = np.array(symbols) diff --git a/amodem/tests/test_configs.py b/amodem/tests/test_configs.py index 7d5c0c1..c7d6eb4 100644 --- a/amodem/tests/test_configs.py +++ b/amodem/tests/test_configs.py @@ -4,3 +4,9 @@ from amodem import config def test_bitrates(): for rate, cfg in sorted(config.bitrates.items()): assert rate * 1000 == cfg.modem_bps + + +def test_slowest(): + c = config.slowest() + assert c.Npoints == 2 + assert list(c.symbols) == [-1j, 1j]