Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ValueError in oct2py calls #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions python/qa_autocorrelate.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def test_001_t (self):
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
print oc
[expected_S_x, data] = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB)
expected_S_x, data = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB, nout=2)
expected_S_x = tuple(expected_S_x)
expected_S_x = list(itertools.chain.from_iterable(expected_S_x))
# num of snapshots
n_ss = len(expected_S_x)/(num_inputs*num_inputs)
n_ss = len(expected_S_x)//(num_inputs*num_inputs)

##################################################
# Blocks & Connections
Expand Down Expand Up @@ -97,11 +97,11 @@ def test_002_t (self):
# Generate auto-correlation vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
[expected_S_x, data] = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB)
expected_S_x, data = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB, nout=2)
expected_S_x = tuple(expected_S_x)
expected_S_x = list(itertools.chain.from_iterable(expected_S_x))
# num of snapshots
n_ss = len(expected_S_x)/(num_inputs*num_inputs)
n_ss = len(expected_S_x)//(num_inputs*num_inputs)

##################################################
# Blocks & Connections
Expand Down Expand Up @@ -143,11 +143,11 @@ def test_003_t (self):
# Generate auto-correlation vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
[expected_S_x, data] = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB)
expected_S_x, data = oc.doa_testbench_create('autocorrelate_test_input_gen', len_ss, overlap_size, num_inputs, FB, nout=2)
expected_S_x = tuple(expected_S_x)
expected_S_x = list(itertools.chain.from_iterable(expected_S_x))
# num of snapshots
n_ss = len(expected_S_x)/(num_inputs*num_inputs)
n_ss = len(expected_S_x)//(num_inputs*num_inputs)

##################################################
# Blocks & Connections
Expand Down
12 changes: 6 additions & 6 deletions python/qa_calibrate_lin_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_001_t (self):
# Generate auto-correlation vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa)
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa, nout=3)
S_x_uncalibrated = S_x_uncalibrated.flatten().tolist()
ant_pert_vec = list(itertools.chain.from_iterable(ant_pert_vec))

Expand All @@ -80,7 +80,7 @@ def test_001_t (self):
ant_pert_vec_est = self.vec_sink.data()
ant_pert_vec_est = numpy.asarray(ant_pert_vec_est, 'F')
# num of snapshots
n_ss = len(ant_pert_vec_est)/num_ant_ele
n_ss = len(ant_pert_vec_est)//num_ant_ele

# check data
ant_ele_range = range(0, num_ant_ele)
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_002_t (self):
# Generate auto-correlation vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa)
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa, nout=3)
S_x_uncalibrated = S_x_uncalibrated.flatten().tolist()
ant_pert_vec = list(itertools.chain.from_iterable(ant_pert_vec))

Expand All @@ -135,7 +135,7 @@ def test_002_t (self):
ant_pert_vec_est = self.vec_sink.data()
ant_pert_vec_est = numpy.asarray(ant_pert_vec_est, 'F')
# num of snapshots
n_ss = len(ant_pert_vec_est)/num_ant_ele
n_ss = len(ant_pert_vec_est)//num_ant_ele

# check data
ant_ele_range = range(0, num_ant_ele)
Expand Down Expand Up @@ -166,7 +166,7 @@ def test_003_t (self):
# Generate auto-correlation vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa)
S_x, S_x_uncalibrated, ant_pert_vec = oc.doa_testbench_create('music_test_input_gen', len_ss, overlap_size, num_ant_ele, FB, 'linear', num_ant_ele, norm_spacing, PERTURB, pilot_doa, nout=3)
S_x_uncalibrated = S_x_uncalibrated.flatten().tolist()
ant_pert_vec = list(itertools.chain.from_iterable(ant_pert_vec))

Expand All @@ -190,7 +190,7 @@ def test_003_t (self):
ant_pert_vec_est = self.vec_sink.data()
ant_pert_vec_est = numpy.asarray(ant_pert_vec_est, 'F')
# num of snapshots
n_ss = len(ant_pert_vec_est)/num_ant_ele
n_ss = len(ant_pert_vec_est)//num_ant_ele

# check data
ant_ele_range = range(0, num_ant_ele)
Expand Down
6 changes: 4 additions & 2 deletions python/qa_find_local_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def test_001_t (self):
# generate vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.dirname(__file__))
data, expected_pks, expected_t_pks = oc.test001_findpeaks(self.num_max_vals, self.vector_len)
data, expected_pks, expected_t_pks = oc.test001_findpeaks(self.num_max_vals, self.vector_len, nout=3)
data = data.flatten().tolist()
expected_pks = expected_pks.flatten().tolist()

##################################################
# Blocks
Expand Down Expand Up @@ -80,8 +81,9 @@ def test_002_t (self):
# generate vector from octave
oc = oct2py.Oct2Py()
oc.addpath(os.path.dirname(__file__))
data, expected_pks, expected_t_pks = oc.test002_findpeaks(self.num_max_vals, self.vector_len)
data, expected_pks, expected_t_pks = oc.test002_findpeaks(self.num_max_vals, self.vector_len, nout=3)
data = data.flatten().tolist()
expected_pks = expected_pks.flatten().tolist()

##################################################
# Blocks
Expand Down