def testOneValue(self): gen = VectorInput([1.0]) strongDecay = sStrongDecay() p = Pool() gen.data >> strongDecay.signal strongDecay.strongDecay >> (p, 'strongDecay') self.assertRaises(EssentiaException, lambda: run(gen))
def testEmpty(self): gen = VectorInput([]) strongDecay = sStrongDecay() p = Pool() gen.data >> strongDecay.signal strongDecay.strongDecay >> (p, 'strongDecay') run(gen) self.assertEqual(len(p.descriptorNames()), 0)
def testRegression(self): # borrowing lpc's input vector for this regression test input = readVector(join(filedir(), 'lpc', 'input.txt')) gen = VectorInput(input) strongDecay = sStrongDecay() p = Pool() gen.data >> strongDecay.signal strongDecay.strongDecay >> (p, 'strongDecay') run(gen) self.assertAlmostEqual(p['strongDecay'], StrongDecay()(input), 1e-6)