Skip to content

Commit fab60ef

Browse files
committed
Change doc and test to the more general iterable input
1 parent 34bdc43 commit fab60ef

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

commpy/sequences.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def pnsequence(pn_order, pn_seed, pn_mask, seq_length):
2929
pn_order : int
3030
Number of delay elements used in the LFSR.
3131
32-
pn_seed : string containing 0's and 1's
32+
pn_seed : iterable providing 0's and 1's
3333
Seed for the initialization of the LFSR delay elements.
3434
The length of this string must be equal to 'pn_order'.
3535
36-
pn_mask : string containing 0's and 1's
36+
pn_mask : iterable providing 0's and 1's
3737
Mask representing which delay elements contribute to the feedback
3838
in the LFSR. The length of this string must be equal to 'pn_order'.
3939

commpy/tests/test_sequences.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def test_pnsequence():
1515
pnsequence(4, '0011', '110', 2 ** 4 - 1)
1616

1717
# Test output with
18-
assert_equal(pnsequence(4, '0011', '1101', 7), array((1, 1, 0, 0, 1, 0, 1), int),
18+
assert_equal(pnsequence(4, '0011', [1, 1, 0, 1], 7), array((1, 1, 0, 0, 1, 0, 1), int),
19+
err_msg='Pseudo-noise sequence is not the one expected.')
20+
assert_equal(pnsequence(4, (0, 0, 1, 1), array((1, 1, 0, 1)), 7), array((1, 1, 0, 0, 1, 0, 1), int),
1921
err_msg='Pseudo-noise sequence is not the one expected.')
2022

2123
if __name__ == "__main__":

0 commit comments

Comments
 (0)