summaryrefslogtreecommitdiff
path: root/gr-fec
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-10-20 18:30:35 -0400
committerTom Rondeau <tom@trondeau.com>2015-10-20 18:30:35 -0400
commite0a70a9257290dbf43c2936acf6ccbb4393295cb (patch)
tree56f65660e18d3d894bbc954c2bc0dda466fb3e33 /gr-fec
parentf3cd58009b5939f5dffeed0b2767ea42bfc1c78f (diff)
fec: conditionalize use of matplotlib in polar code helper functions.
Make it so that we don't require matplotlib just to run QA tests.
Diffstat (limited to 'gr-fec')
-rw-r--r--gr-fec/python/fec/polar/channel_construction.py12
-rwxr-xr-xgr-fec/python/fec/polar/channel_construction_bsc.py8
2 files changed, 11 insertions, 9 deletions
diff --git a/gr-fec/python/fec/polar/channel_construction.py b/gr-fec/python/fec/polar/channel_construction.py
index a7f048c5b9..477e1df605 100644
--- a/gr-fec/python/fec/polar/channel_construction.py
+++ b/gr-fec/python/fec/polar/channel_construction.py
@@ -29,7 +29,6 @@ from channel_construction_bec import design_snr_to_bec_eta
from channel_construction_bec import bhattacharyya_bounds
from channel_construction_bsc import tal_vardy_tpm_algorithm
from helper_functions import *
-import matplotlib.pyplot as plt
Z_PARAM_FIRST_HEADER_LINE = "Bhattacharyya parameters (Z-parameters) for a polar code"
@@ -128,12 +127,13 @@ def main():
z_params = load_z_parameters(m, design_snr, mu)
z_bounds = bhattacharyya_bounds(design_snr, m)
print(z_params[-10:])
- plt.plot(z_params)
- plt.plot(z_bounds)
- plt.show()
+
+ if 0:
+ import matplotlib.pyplot as plt
+ plt.plot(z_params)
+ plt.plot(z_bounds)
+ plt.show()
if __name__ == '__main__':
main()
-
-
diff --git a/gr-fec/python/fec/polar/channel_construction_bsc.py b/gr-fec/python/fec/polar/channel_construction_bsc.py
index e16813fcb7..77057a7c1c 100755
--- a/gr-fec/python/fec/polar/channel_construction_bsc.py
+++ b/gr-fec/python/fec/polar/channel_construction_bsc.py
@@ -31,7 +31,6 @@ for an overview of different approaches
from scipy.optimize import fsolve
from scipy.special import erfc
from helper_functions import *
-import matplotlib.pyplot as plt
from channel_construction_bec import bhattacharyya_bounds
@@ -272,8 +271,11 @@ def main():
z_params = tal_vardy_tpm_algorithm(m, design_snr, mu)
print(z_params)
- plt.plot(z_params)
- plt.show()
+
+ if 0:
+ import matplotlib.pyplot as plt
+ plt.plot(z_params)
+ plt.show()
if __name__ == '__main__':