Mercurial > hg > vampy-host
annotate test/test_collect.py @ 82:a11b57e9fb0b
naming: module methods snake_case
author | Chris Cannam |
---|---|
date | Wed, 21 Jan 2015 12:43:50 +0000 |
parents | cb0380c92c42 |
children | 78844c4b329c |
rev | line source |
---|---|
Chris@71 | 1 |
Chris@71 | 2 import vamp |
Chris@71 | 3 import numpy as np |
Chris@71 | 4 |
Chris@82 | 5 plugin_key = "vamp-test-plugin:vamp-test-plugin" |
Chris@82 | 6 plugin_key_freq = "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@82 | 24 results = vamp.collect(buf, rate, plugin_key, {}, "input-summary") |
Chris@71 | 25 assert type(results) == dict |