Skip to content

Commit 1d06739

Browse files
committed
Force use of Python 3 for all scripts.
1 parent 8eaebc0 commit 1d06739

File tree

11 files changed

+19
-19
lines changed

11 files changed

+19
-19
lines changed

octave/fsk_demod_BER_test.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Perform automated Eb/N0 testing of the C-implementation of fsk_mod / fsk_demod
44
#

octave/fskdemodgui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# fsk_demod Statistics GUI
44
# Accepts the stats output from fsk_demod on stdin, and plots it.

octave/plot_fsk_demod_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Plot fsk_demod statistic outputs.
44
#

stm32/support/hex2dfu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
#
33
# Intel HEX to ST microelectronics DfuSe file converter
44
# Copyright (C)2015 Thomas Kindler <mail@t-kindler.de>

stm32/support/intelhex/bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
# (c) Alexander Belchenko, 2007, 2009
33

44
"""Benchmarking.

stm32/support/intelhex/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22

33
# Copyright (c) 2005-2013, Alexander Belchenko
44
# All rights reserved.

stm32/unittest/scripts/tst_api_demod_check

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ cd "${RUN_DIR}"
2222
# way of performing a rough comparsion of two output speech files that are not exactly the same
2323

2424
function compare_energy() {
25-
energy_ref=$(python -c "import numpy as np; x=np.fromfile(\"ref_demod.raw\",dtype=\"int16\").astype(float); print(10*np.log10(np.dot(x,x)))")
26-
energy_target=$(python -c "import numpy as np; x=np.fromfile(\"stm_out.raw\",dtype=\"int16\").astype(float); print(10*np.log10(np.dot(x,x)))")
25+
energy_ref=$(python3 -c "import numpy as np; x=np.fromfile(\"ref_demod.raw\",dtype=\"int16\").astype(float); print(10*np.log10(np.dot(x,x)))")
26+
energy_target=$(python3 -c "import numpy as np; x=np.fromfile(\"stm_out.raw\",dtype=\"int16\").astype(float); print(10*np.log10(np.dot(x,x)))")
2727
printf "ref energy: %f target energy: %f\n" $energy_ref $energy_target
2828

29-
python -c "import sys; sys.exit(1) if abs($energy_ref-$energy_target) < 1 else sys.exit(0)"
29+
python3 -c "import sys; sys.exit(1) if abs($energy_ref-$energy_target) < 1 else sys.exit(0)"
3030
if [[ $? -eq 1 ]]; then echo "energy compare OK";
3131
else echo "energy compare BAD";
3232
let Fails=($Fails + 1)
@@ -68,7 +68,7 @@ case "${TEST_OPT}" in
6868
# for such a short test, so we'll just sanity check the
6969
# reference uncoded BER here. Bash can't compare floats
7070
# .... so use return code of some python script
71-
python -c "import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
71+
python3 -c "import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
7272
if [[ $? -eq 1 ]]; then echo "OK";
7373
else echo "BAD";
7474
let Fails=($Fails + 1)
@@ -78,7 +78,7 @@ case "${TEST_OPT}" in
7878
uber_target=$(cat stderr.log | sed -n "s/^BER.*: \([0-9..]*\).*Tbits.*/\1/p")
7979
cber_target=$(cat stderr.log | sed -n "s/^Coded BER.*: \([0-9..]*\).*Tbits.*/\1/p")
8080
printf "TARGET uncoded BER: %f coded BER: %f\n" $uber_target $cber_target
81-
python -c "import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref-$cber_target) < 0.01 else sys.exit(0)"
81+
python3 -c "import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref-$cber_target) < 0.01 else sys.exit(0)"
8282
if [[ $? -eq 1 ]]; then echo "OK";
8383
else echo "BAD";
8484
let Fails=($Fails + 1)
@@ -109,7 +109,7 @@ case "${TEST_OPT}" in
109109
# make sure execution time stays within bounds
110110
execution_time=mktmp
111111
cat stdout.log | sed -n "s/.*freedv_rx \([0-9..]*\) msecs/\1/p" > $execution_time
112-
python -c "import sys; import numpy as np; x=np.loadtxt(\"$execution_time\"); print(\"execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
112+
python3 -c "import sys; import numpy as np; x=np.loadtxt(\"$execution_time\"); print(\"execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
113113
if [[ $? -eq 1 ]]; then echo "execution time OK";
114114
else echo "BAD";
115115
let Fails=($Fails + 1)
@@ -145,7 +145,7 @@ case "${TEST_OPT}" in
145145
# for such a short test, so we'll just sanity check the
146146
# reference uncoded BER here. Bash can't compare floats
147147
# .... so use return code of some python script
148-
python -c "import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
148+
python3 -c "import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
149149
if [[ $? -eq 1 ]]; then echo "OK";
150150
else echo "BAD";
151151
let Fails=($Fails + 1)
@@ -155,7 +155,7 @@ case "${TEST_OPT}" in
155155
uber_target=$(cat stderr.log | sed -n "s/^BER.*: \([0-9..]*\).*Tbits.*/\1/p")
156156
cber_target=$(cat stderr.log | sed -n "s/^Coded BER.*: \([0-9..]*\).*Tbits.*/\1/p")
157157
printf "TARGET uncoded BER: %f coded BER: %f\n" $uber_target $cber_target
158-
python -c "import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref-$cber_target) < 0.01 else sys.exit(0)"
158+
python3 -c "import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref-$cber_target) < 0.01 else sys.exit(0)"
159159
if [[ $? -eq 1 ]]; then echo "OK";
160160
else echo "BAD";
161161
let Fails=($Fails + 1)
@@ -186,7 +186,7 @@ case "${TEST_OPT}" in
186186
# make sure execution time stays within bounds
187187
execution_time=mktmp
188188
cat stdout.log | sed -n "s/.*freedv_rx \([0-9..]*\) msecs/\1/p" > $execution_time
189-
python -c "import sys; import numpy as np; x=np.loadtxt(\"$execution_time\"); print(\"execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
189+
python3 -c "import sys; import numpy as np; x=np.loadtxt(\"$execution_time\"); print(\"execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
190190
if [[ $? -eq 1 ]]; then echo "execution time OK";
191191
else echo "BAD";
192192
let Fails=($Fails + 1)

unittest/ofdm_fade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ pwd
1818
ofdm_mod --in /dev/zero --ldpc 1 --testframes 60 --txbpf | cohpsk_ch - - -24 --Fs 8000 -f -10 --mpp --raw_dir ../raw | ofdm_demod --out /dev/null --testframes --verbose 2 --ldpc 1 2> $results
1919
cat $results
2020
cber=$(cat $results | sed -n "s/^Coded BER.* \([0-9..]*\) Tbits.*/\1/p")
21-
python -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"
21+
python3 -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"

unittest/ofdm_fade_dpsk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ cohpsk_ch - - -40 --Fs 8000 -f 10 --ssbfilt 1 --mpd --raw_dir $RAW --multipath_d
2222
ofdm_demod --out /dev/null --testframes --mode 2020 --verbose 1 --ldpc -p 312 --dpsk 2> $results
2323
cat $results
2424
cber=$(cat $results | sed -n "s/^Coded BER.* \([0-9..]*\) Tbits.*/\1/p")
25-
python -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"
25+
python3 -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"

unittest/ofdm_phase_est_bw.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ cohpsk_ch - - -40 --Fs 8000 -f 10 --ssbfilt 1 --mpp --raw_dir ../raw | \
3030
ofdm_demod --out /dev/null --testframes --mode 2020 --verbose 2 --ldpc -p 312 --bandwidth 1 2> $results
3131
cat $results
3232
cber=$(cat $results | sed -n "s/^Coded BER.* \([0-9..]*\) Tbits.*/\1/p")
33-
python -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"
33+
python3 -c "import sys; sys.exit(0) if $cber<=0.05 else sys.exit(1)"

0 commit comments

Comments
 (0)