# HG changeset patch # User Chris Cannam # Date 1421255944 0 # Node ID ffdeb8808fc1ace4f49d1191e15f843ef31df00c # Parent b34d3b58da98abe84d7fde28eec472f84fd8c51b Let's favour consistent shape in output, and return the output identifier always diff -r b34d3b58da98 -r ffdeb8808fc1 Makefile.inc --- a/Makefile.inc Wed Jan 14 14:53:15 2015 +0000 +++ b/Makefile.inc Wed Jan 14 17:19:04 2015 +0000 @@ -8,6 +8,8 @@ HEADERS := $(SRC_DIR)/PyPluginObject.h $(SRC_DIR)/PyRealTime.h $(SRC_DIR)/FloatConversion.h $(SRC_DIR)/VectorConversion.h SOURCES := $(SRC_DIR)/PyPluginObject.cpp $(SRC_DIR)/PyRealTime.cpp $(SRC_DIR)/VectorConversion.cpp $(SRC_DIR)/vampyhost.cpp + +PY := $(wildcard vamp/*.py) TESTS := $(wildcard test/test_*.py) OBJECTS := $(SOURCES:.cpp=.o) @@ -18,7 +20,7 @@ $(LIBRARY): $(OBJECTS) $(CXX) -o $@ $^ $(LDFLAGS) -.tests: $(LIBRARY) $(TESTS) +.tests: $(LIBRARY) $(PY) $(TESTS) $(NOSE) @touch $@ diff -r b34d3b58da98 -r ffdeb8808fc1 test/test_process.py --- a/test/test_process.py Wed Jan 14 14:53:15 2015 +0000 +++ b/test/test_process.py Wed Jan 14 17:19:04 2015 +0000 @@ -50,7 +50,7 @@ # the first elt (which is i * blockSize + 1) # expected = blocksize + i * blocksize + 1 - actual = results[i]["values"][0] + actual = results[i]["input-summary"]["values"][0] assert actual == expected def test_process_freq_summary(): @@ -87,7 +87,7 @@ if (i == len(results)-1): expected = 0 expected = expected + blocksize - 1 # non-zero elts - actual = results[i]["values"][0] + actual = results[i]["input-summary"]["values"][0] eps = 1e-6 assert abs(actual - expected) < eps @@ -99,7 +99,7 @@ # The timestamp should be the frame number of the first frame in the # input buffer expected = i * blocksize - actual = results[i]["values"][0] + actual = results[i]["input-timestamp"]["values"][0] assert actual == expected def test_process_freq_timestamps(): @@ -110,6 +110,6 @@ # The timestamp should be the frame number of the frame just beyond # half-way through the input buffer expected = i * (blocksize/2) + blocksize/2 - actual = results[i]["values"][0] + actual = results[i]["input-timestamp"]["values"][0] print("actual = " + str(actual) + ", expected = " + str(expected)) assert actual == expected diff -r b34d3b58da98 -r ffdeb8808fc1 vamp/__init__.py --- a/vamp/__init__.py Wed Jan 14 14:53:15 2015 +0000 +++ b/vamp/__init__.py Wed Jan 14 17:19:04 2015 +0000 @@ -68,8 +68,6 @@ if outputs == []: outputs = [plugOuts[0]["identifier"]] - singleOutput = (len(outputs) == 1) - ff = framesFromArray(data, stepSize, blockSize) fi = 0 @@ -79,20 +77,14 @@ for o in outputs: if outIndices[o] in results: for r in results[outIndices[o]]: - if singleOutput: - yield r - else: - yield { o: r } + yield { o: r } fi = fi + stepSize results = plug.getRemainingFeatures() for o in outputs: if outIndices[o] in results: for r in results[outIndices[o]]: - if singleOutput: - yield r - else: - yield { o: r } + yield { o: r } plug.unload()