diff options
Diffstat (limited to 'gr-wavelet/python')
-rw-r--r-- | gr-wavelet/python/wavelet/CMakeLists.txt (renamed from gr-wavelet/python/CMakeLists.txt) | 23 | ||||
-rw-r--r-- | gr-wavelet/python/wavelet/__init__.py (renamed from gr-wavelet/python/__init__.py) | 9 | ||||
-rwxr-xr-x | gr-wavelet/python/wavelet/qa_classify.py (renamed from gr-wavelet/python/qa_classify.py) | 13 |
3 files changed, 23 insertions, 22 deletions
diff --git a/gr-wavelet/python/CMakeLists.txt b/gr-wavelet/python/wavelet/CMakeLists.txt index 7f7fd99ecf..ae9d3dc794 100644 --- a/gr-wavelet/python/CMakeLists.txt +++ b/gr-wavelet/python/wavelet/CMakeLists.txt @@ -32,20 +32,17 @@ GR_PYTHON_INSTALL( ######################################################################## if(ENABLE_TESTING) -list(APPEND GR_TEST_PYTHON_DIRS - ${CMAKE_BINARY_DIR}/gr-analog/python - ${CMAKE_BINARY_DIR}/gr-analog/swig - ${CMAKE_BINARY_DIR}/gr-wavelet/python - ${CMAKE_BINARY_DIR}/gr-wavelet/swig - ${CMAKE_BINARY_DIR}/gr-blocks/python - ${CMAKE_BINARY_DIR}/gr-blocks/swig -) -list(APPEND GR_TEST_TARGET_DEPS gnuradio-wavelet) + set(GR_TEST_TARGET_DEPS "") + set(GR_TEST_LIBRARY_DIRS "") + set(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gruel/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ) -include(GrTest) -file(GLOB py_qa_test_files "qa_*.py") -foreach(py_qa_test_file ${py_qa_test_files}) + include(GrTest) + file(GLOB py_qa_test_files "qa_*.py") + foreach(py_qa_test_file ${py_qa_test_files}) get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) -endforeach(py_qa_test_file) + endforeach(py_qa_test_file) endif(ENABLE_TESTING) diff --git a/gr-wavelet/python/__init__.py b/gr-wavelet/python/wavelet/__init__.py index cf86408e95..7f3d9afa53 100644 --- a/gr-wavelet/python/__init__.py +++ b/gr-wavelet/python/wavelet/__init__.py @@ -22,6 +22,11 @@ ''' Processing blocks for wavelet transforms. ''' +import os -from wavelet_swig import * - +try: + from wavelet_swig import * +except ImportError: + dirname, filename = os.path.split(os.path.abspath(__file__)) + __path__.append(os.path.join(dirname, "..", "..", "swig")) + from wavelet_swig import * diff --git a/gr-wavelet/python/qa_classify.py b/gr-wavelet/python/wavelet/qa_classify.py index 8dfc6ca5f9..4752620f4d 100755 --- a/gr-wavelet/python/qa_classify.py +++ b/gr-wavelet/python/wavelet/qa_classify.py @@ -21,13 +21,10 @@ # import numpy -from gnuradio import gr, gr_unittest +from gnuradio import gr, gr_unittest, wavelet, analog, blocks import copy #import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config import math -import wavelet_swig -import analog_swig as analog -import blocks_swig as blocks def sqr(x): return x*x @@ -108,7 +105,7 @@ class test_classify(gr_unittest.TestCase): src_data = (0.0, 1.0, 0.0, 1.0, 0.0) src = blocks.vector_source_f(src_data, False, len(src_grid)) - sq = wavelet_swig.squash_ff(src_grid, trg_grid) + sq = wavelet.squash_ff(src_grid, trg_grid) dst = blocks.vector_sink_f(len(trg_grid)) self.tb.connect(src, sq) self.tb.connect(sq, dst) @@ -133,8 +130,10 @@ class test_classify(gr_unittest.TestCase): # c = w.transform_forward(b, ws) # d = w.transform_inverse(c, ws) # +# src = gr.vector_source_f(b, False, n) +# wv = wavelet.wavelet_ff(n, o, True) # src = blocks.vector_source_f(b, False, n) -# wv = wavelet_swig.wavelet_ff(n, o, True) +# wv = wavelet.wavelet_ff(n, o, True) # # dst = blocks.vector_sink_f(n) # self.tb.connect(src, wv) @@ -163,7 +162,7 @@ class test_classify(gr_unittest.TestCase): k += 01<<e src = blocks.vector_source_f(src_data, False, len(src_data)) - kon = wavelet_swig.wvps_ff(len(src_data)) + kon = wavelet.wvps_ff(len(src_data)) dst = blocks.vector_sink_f(int(math.ceil(math.log(len(src_data), 2)))) self.tb.connect(src, kon) |