Commit 3a13d7a0 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

Merge branch 'fix-issue4' into 'master'

Fix crash of get_shape and add test. Fix for issue #4

See merge request !4
parents 3f422732 ada2453a
Pipeline #7711 passed with stages
in 8 minutes and 55 seconds
......@@ -468,7 +468,7 @@ static PyObject* PyBobApFrameExtractor_GetShapeArray
PyBlitzArrayObject* input = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kwlist,
&input, &PyBlitzArray_Converter)) return 0;
&PyBlitzArray_Converter, &input)) return 0;
auto input_ = make_safe(input);
if (input->ndim != 1 || input->type_num != NPY_FLOAT64) {
......
......@@ -61,10 +61,13 @@ def energy_computation(rate_wavsample, win_length_ms, win_shift_ms, normalize_me
def energy_comparison_run(rate_wavsample, win_length_ms, win_shift_ms, normalize_mean):
c = Energy(rate_wavsample[0], win_length_ms, win_shift_ms, normalize_mean)
shape_a = c.get_shape(rate_wavsample[1])
A = c(rate_wavsample[1])
B = energy_computation(rate_wavsample, win_length_ms, win_shift_ms, normalize_mean)
shape_b = B.shape
assert shape_a != shape_b
diff=numpy.sum(numpy.sum((A-B)*(A-B)))
assert numpy.allclose(diff, 0., rtol=1e-07, atol=1e-05)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment