annotate test/test_collect.py @ 71:cb0380c92c42

Stub out a collect() function which will (?) assemble a suitable structure from an entire run
author Chris Cannam
date Wed, 14 Jan 2015 17:33:16 +0000
parents
children a11b57e9fb0b
rev   line source
Chris@71 1
Chris@71 2 import vamp
Chris@71 3 import numpy as np
Chris@71 4
Chris@71 5 testPluginKey = "vamp-test-plugin:vamp-test-plugin"
Chris@71 6 testPluginKeyFreq = "vamp-test-plugin:vamp-test-plugin-freq"
Chris@71 7
Chris@71 8 rate = 44100
Chris@71 9
Chris@71 10 # Throughout this file we have the assumption that the plugin gets run with a
Chris@71 11 # blocksize of 1024, and with a step of 1024 for the time-domain version or 512
Chris@71 12 # for the frequency-domain one. That is certainly expected to be the norm for a
Chris@71 13 # plugin like this that declares no preference, and the Python Vamp module is
Chris@71 14 # expected to follow the norm
Chris@71 15
Chris@71 16 blocksize = 1024
Chris@71 17
Chris@71 18 def input_data(n):
Chris@71 19 # start at 1, not 0 so that all elts are non-zero
Chris@71 20 return np.arange(n) + 1
Chris@71 21
Chris@71 22 def test_collect_runs_at_all():
Chris@71 23 buf = input_data(blocksize)
Chris@71 24 results = vamp.collect(buf, rate, testPluginKey, {}, "input-summary")
Chris@71 25 assert type(results) == dict