コード例 #1
0
    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))
コード例 #2
0
    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))
コード例 #3
0
    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)
コード例 #4
0
    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)
コード例 #5
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)
コード例 #6
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)