mirror of
https://github.com/romanz/amodem.git
synced 2026-04-18 04:06:00 +08:00
Drop izip compatibility helper
This commit is contained in:
@@ -73,16 +73,6 @@ def take(iterable, n):
|
|||||||
return np.array(list(itertools.islice(iterable, n)))
|
return np.array(list(itertools.islice(iterable, n)))
|
||||||
|
|
||||||
|
|
||||||
def izip(iterables):
|
|
||||||
""" "Python 3" zip re-implementation for Python 2. """
|
|
||||||
iterables = [iter(iterable) for iterable in iterables]
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
yield tuple([next(iterable) for iterable in iterables])
|
|
||||||
except StopIteration:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class Dummy:
|
class Dummy:
|
||||||
""" Dummy placeholder object for testing and mocking. """
|
""" Dummy placeholder object for testing and mocking. """
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class Receiver:
|
|||||||
bits = self.modem.decode(S, freq_handler) # list of bit tuples
|
bits = self.modem.decode(S, freq_handler) # list of bit tuples
|
||||||
streams.append(bits) # bit stream per frequency
|
streams.append(bits) # bit stream per frequency
|
||||||
|
|
||||||
return common.izip(streams), symbol_list
|
return zip(*streams), symbol_list
|
||||||
|
|
||||||
def _demodulate(self, sampler, symbols):
|
def _demodulate(self, sampler, symbols):
|
||||||
symbol_list = []
|
symbol_list = []
|
||||||
|
|||||||
@@ -48,12 +48,6 @@ def test_dumps_loads():
|
|||||||
assert all(x == y)
|
assert all(x == y)
|
||||||
|
|
||||||
|
|
||||||
def test_izip():
|
|
||||||
x = range(10)
|
|
||||||
y = range(-10, 0)
|
|
||||||
assert list(common.izip([x, y])) == list(zip(x, y))
|
|
||||||
|
|
||||||
|
|
||||||
def test_configs():
|
def test_configs():
|
||||||
default = config.Configuration()
|
default = config.Configuration()
|
||||||
fastest = config.fastest()
|
fastest = config.fastest()
|
||||||
|
|||||||
Reference in New Issue
Block a user